Merge branch 'gingerbread' into gingerbread-release
diff --git a/core/Makefile b/core/Makefile
index 7b67f88..bdd1d7e 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -73,7 +73,7 @@
 
 # The string used to uniquely identify this build;  used by the OTA server.
 ifeq (,$(strip $(BUILD_FINGERPRINT)))
-  BUILD_FINGERPRINT := $(PRODUCT_BRAND)/$(TARGET_PRODUCT)/$(TARGET_DEVICE)/$(TARGET_BOOTLOADER_BOARD_NAME):$(PLATFORM_VERSION)/$(BUILD_ID)/$(BUILD_NUMBER):$(TARGET_BUILD_VARIANT)/$(BUILD_VERSION_TAGS)
+  BUILD_FINGERPRINT := $(PRODUCT_BRAND)/$(TARGET_PRODUCT)/$(TARGET_DEVICE):$(PLATFORM_VERSION)/$(BUILD_ID)/$(BUILD_NUMBER):$(TARGET_BUILD_VARIANT)/$(BUILD_VERSION_TAGS)
 endif
 ifneq ($(words $(BUILD_FINGERPRINT)),1)
   $(error BUILD_FINGERPRINT cannot contain spaces: "$(BUILD_FINGERPRINT)")
@@ -831,8 +831,6 @@
 .PHONY: userdataimage-nodeps
 userdataimage-nodeps: $(INTERNAL_USERIMAGES_DEPS)
 	$(build-userdataimage-target)
-	$(hide)mkdir -p $(DIST_DIR)
-	$(hide)cp $(INSTALLED_USERDATAIMAGE_TARGET) $(DIST_DIR)
 
 #######
 ## data partition tarball
@@ -1106,12 +1104,15 @@
 .PHONY: tests-zip-package
 tests-zip-package: $(BUILT_TESTS_ZIP_PACKAGE)
 
-# Dist the files needed by tests builds
-# So the build server can run the following commands to build tests packages while avoid a full build:
-# $make -j16 tests-zip-package userdataimage-nodeps dist showcommands TARGET_BUILD_VARIANT=tests TARGET_PRODUCT=passion
-ifeq ($(filter $(DEFAULT_GOAL) tests-zip-package,$(MAKECMDGOALS)),tests-zip-package)
-  $(call dist-for-goals, tests-zip-package, \
-     $(BUILT_TESTS_ZIP_PACKAGE))
+# Target needed by tests build
+.PHONY: tests-build-target
+tests-build-target: $(BUILT_TESTS_ZIP_PACKAGE) \
+                    $(BUILT_USERDATAIMAGE_TARGET)
+
+ifneq (,$(filter $(MAKECMDGOALS),tests-build-target))
+  $(call dist-for-goals, tests-build-target, \
+          $(BUILT_TESTS_ZIP_PACKAGE) \
+          $(BUILT_USERDATAIMAGE_TARGET))
 endif
 
 # -----------------------------------------------------------------
diff --git a/core/base_rules.mk b/core/base_rules.mk
index 7e277ec..db05e00 100644
--- a/core/base_rules.mk
+++ b/core/base_rules.mk
@@ -73,6 +73,28 @@
   ifeq ($(filter $(GRANDFATHERED_USER_MODULES),$(LOCAL_MODULE)),)
     $(warning *** Module name: $(LOCAL_MODULE))
     $(warning *** Makefile location: $(LOCAL_PATH))
+    $(warning * )
+    $(warning * Each module must use a LOCAL_MODULE_TAGS in its)
+    $(warning * Android.mk. Possible tags declared by a module:)
+    $(warning * )
+    $(warning *     optional, debug, eng, tests, samples)
+    $(warning * )
+    $(warning * If the module is expected to be in all builds)
+    $(warning * of a product, then it should use the)
+    $(warning * "optional" tag: )
+    $(warning * )
+    $(warning *    Add "LOCAL_MODULE_TAGS := optional" in the)
+    $(warning *    Android.mk for the affected module, and add)
+    $(warning *    the LOCAL_MODULE value for that component)
+    $(warning *    into the PRODUCT_PACKAGES section of product)
+    $(warning *    makefile(s) where it's necessary, if)
+    $(warning *    appropriate.)
+    $(warning * )
+    $(warning * If the component should be in EVERY build of ALL)
+    $(warning * products, then add its LOCAL_MODULE value to the)
+    $(warning * PRODUCT_PACKAGES section of)
+    $(warning * build/target/product/core.mk)
+    $(warning * )
     $(error user tag detected on new module - user tags are only supported on legacy modules)
   endif
 endif
diff --git a/core/main.mk b/core/main.mk
index 8d6fddf..f3ec53f 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -741,17 +741,6 @@
     $(INSTALLED_RAMDISK_TARGET) \
    )
 
-  # Tests are installed in userdata.img.  If we're building the tests
-  # variant, copy it for "make tests dist".  Also copy a zip of the
-  # contents of userdata.img, so that people can easily extract a
-  # single .apk.
-  ifeq ($(TARGET_BUILD_VARIANT),tests)
-  $(call dist-for-goals, droid, \
-    $(INSTALLED_USERDATAIMAGE_TARGET) \
-    $(BUILT_TESTS_ZIP_PACKAGE) \
-   )
-  endif
-
 # Building a full system-- the default is to build droidcore
 droid: droidcore dist_libraries
 
diff --git a/core/product_config.mk b/core/product_config.mk
index 7f79ff7..4824245 100644
--- a/core/product_config.mk
+++ b/core/product_config.mk
@@ -119,6 +119,11 @@
     default_goal_substitution := $(DEFAULT_GOAL)
   endif
 
+  # For tests build, only build tests-build-target
+  ifeq (tests,$(TARGET_BUILD_VARIANT))
+    default_goal_substitution := tests-build-target
+  endif
+
   # Hack to make the linux build servers use dexpreopt (emulator-based
   # preoptimization). Most engineers don't use this type of target
   # ("make PRODUCT-blah-user"), so this should only tend to happen when
diff --git a/core/user_tags.mk b/core/user_tags.mk
index 1c6a56a..f1eab9b 100644
--- a/core/user_tags.mk
+++ b/core/user_tags.mk
@@ -32,6 +32,8 @@
 	aapt \
 	acp \
 	adb \
+	AdbWinApi \
+	AdbWinUsbApi \
 	adbd \
 	aidl \
 	am \
@@ -172,6 +174,7 @@
 	kcm \
 	keystore \
 	kxml2-2.3.0 \
+	launch-wrapper \
 	layoutlib \
 	layoutlib_api \
 	layoutlib_create \
@@ -371,6 +374,7 @@
 	libvpx \
 	libwebcore \
 	libwpa_client \
+	libwrapsim \
 	libxml2 \
 	libz \
 	libzipfile \
@@ -437,9 +441,11 @@
 	rild \
 	rsg-generator \
 	run-as \
+	runtime \
 	schedtest \
 	screenshot2 \
 	sdcard \
+	sdklauncher \
 	sdklib \
 	sdkmanager \
 	sdkstats \
@@ -460,6 +466,7 @@
 	signapk \
 	signature-tools \
 	simg2img \
+	simulator \
 	soslim \
 	spec-progress \
 	sqlite3 \
diff --git a/target/board/Android.mk b/target/board/Android.mk
index ac8cb44..82dee3c 100644
--- a/target/board/Android.mk
+++ b/target/board/Android.mk
@@ -23,16 +23,7 @@
 # Use the add-radio-file function to add values to this variable.
 INSTALLED_RADIOIMAGE_TARGET :=
 
-ifeq (,$(wildcard $(TARGET_DEVICE_DIR)/AndroidBoard.mk))
-  ifeq (,$(wildcard $(TARGET_DEVICE_DIR)/Android.mk))
-    $(error Missing "$(TARGET_DEVICE_DIR)/AndroidBoard.mk")
-  else
-    # TODO: Remove this check after people have had a chance to switch,
-    # after April 2009.
-    $(error Please rename "$(TARGET_DEVICE_DIR)/Android.mk" to "$(TARGET_DEVICE_DIR)/AndroidBoard.mk")
-  endif
-endif
-include $(TARGET_DEVICE_DIR)/AndroidBoard.mk
+-include $(TARGET_DEVICE_DIR)/AndroidBoard.mk
 
 # Generate a file that contains various information about the
 # device we're building for.  This file is typically packaged up