OSDN Git Service

Merge "Fix typo" am: 342037c0cf
authorDan Willemsen <dwillemsen@google.com>
Tue, 2 Feb 2016 18:04:40 +0000 (18:04 +0000)
committerandroid-build-merger <android-build-merger@google.com>
Tue, 2 Feb 2016 18:04:40 +0000 (18:04 +0000)
am: 5f5ad2d2ea

* commit '5f5ad2d2ea41bdc68ed21b3713e60a5613664b9b':
  Fix typo

48 files changed:
CleanSpec.mk
core/Makefile
core/aapt2.mk [new file with mode: 0644]
core/android_manifest.mk
core/base_rules.mk
core/binary.mk
core/clear_vars.mk
core/combo/javac.mk
core/combo/mac_version.mk
core/config.mk
core/definitions.mk
core/dex_preopt.mk
core/dpi_specific_apk.mk
core/droiddoc.mk
core/host_dalvik_java_library.mk
core/host_dalvik_static_java_library.mk
core/java.mk
core/java_common.mk
core/main.mk
core/package_internal.mk
core/pathmap.mk
core/pdk_config.mk
core/prebuilt_internal.mk
core/product_config.mk
core/proguard.flags
core/static_java_library.mk
core/tasks/apicheck.mk
core/tasks/cts_v2.mk [new file with mode: 0644]
core/tasks/tools/compatibility.mk [new file with mode: 0644]
core/version_defaults.mk
target/board/generic/BoardConfig.mk
target/board/generic_mips/BoardConfig.mk
target/board/generic_mips64/BoardConfig.mk
target/board/generic_x86/BoardConfig.mk
target/board/generic_x86_64/BoardConfig.mk
target/product/base.mk
target/product/core.mk
target/product/embedded.mk
target/product/emulator.mk
target/product/runtime_libart.mk
target/product/sdk_base.mk
target/product/telephony.mk
tools/droiddoc/templates-sdk/components/masthead.cs
tools/droiddoc/templates-sdk/customizations.cs
tools/droiddoc/templates-sdk/designpage.cs
tools/droiddoc/templates-sdk/footer.cs
tools/droiddoc/templates-sdk/head_tag.cs
tools/droiddoc/templates-sdk/sdkpage.cs

index 19cb651..3c8d6ce 100644 (file)
@@ -354,7 +354,7 @@ $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/build.prop)
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/root/default.prop)
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/recovery/root/default.prop)
 
-# Change PLATFORM_VERSION from MNC to M
+# New York, New York!
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/build.prop)
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/app/*)
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/APPS/*)
@@ -364,12 +364,12 @@ $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/build.prop)
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/app/*)
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/APPS/*)
 
-# 23 is becoming more alive!!!
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/build.prop)
-$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/app/*)
-$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/APPS/*)
 
+# Change PLATFORM_VERSION from NYC to N
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/build.prop)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/app/*)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/APPS/*)
 
 # $(PRODUCT_OUT)/recovery/root/sdcard goes from symlink to folder.
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/recovery/root/sdcard)
index b3c3970..d58fac4 100644 (file)
@@ -498,7 +498,6 @@ ifneq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true)
 INTERNAL_BOOTIMAGE_ARGS += --ramdisk $(INSTALLED_RAMDISK_TARGET)
 endif
 
-
 INTERNAL_BOOTIMAGE_FILES := $(filter-out --%,$(INTERNAL_BOOTIMAGE_ARGS))
 
 BOARD_KERNEL_CMDLINE := $(strip $(BOARD_KERNEL_CMDLINE))
diff --git a/core/aapt2.mk b/core/aapt2.mk
new file mode 100644 (file)
index 0000000..5c4cf73
--- /dev/null
@@ -0,0 +1,76 @@
+######################################
+# Compile resource with AAPT2
+# Input variables:
+# full_android_manifest,
+# my_res_resources, my_overlay_resources, my_aapt_characteristics,
+# my_compiled_res_base_dir, rs_generated_res_dir, my_res_package,
+# R_file_stamp, proguard_options_file
+# Output variables:
+# my_res_resources_flat, my_overlay_resources_flat,
+# my_generated_resources_flata
+#
+######################################
+
+
+# Compile all the resource files.
+my_res_resources_flat := \
+  $(foreach r, $(my_res_resources),\
+    $(eval o := $(call aapt2-compiled-resource-out-file,$(r),$(my_compiled_res_base_dir)))\
+    $(eval $(call aapt2-compile-one-resource-file-rule,$(r),$(o)))\
+    $(o))
+
+my_overlay_resources_flat := \
+  $(foreach r, $(my_overlay_resources),\
+    $(eval o := $(call aapt2-compiled-resource-out-file,$(r),$(my_compiled_res_base_dir)))\
+    $(eval $(call aapt2-compile-one-resource-file-rule,$(r),$(o)))\
+    $(o))
+
+my_generated_resources_flata :=
+# Compile generated resources
+ifneq ($(rs_generated_res_dir),)
+rs_gen_resource_flata := $(my_compiled_res_base_dir)/renderscript_gen_res.flata
+$(rs_gen_resource_flata): PRIVATE_SOURCE_RES_DIR := $(rs_generated_res_dir)
+$(rs_gen_resource_flata) : $(RenderScript_file_stamp)
+       @echo "AAPT2 compile $@ <- $(PRIVATE_SOURCE_RES_DIR)"
+       $(call aapt2-compile-one-resource-dir)
+
+my_generated_resources_flata += $(rs_gen_resource_flata)
+endif
+
+$(my_res_resources_flat) $(my_overlay_resources_flat) $(my_generated_resources_flata): \
+  PRIVATE_AAPT2_CFLAGS := $(addprefix --product ,$(my_aapt_characteristics)) $(PRODUCT_AAPT2_CFLAGS)
+
+# Link the static library resource packages.
+my_static_library_resources := $(foreach l, $(LOCAL_STATIC_JAVA_LIBRARIES),\
+  $(call intermediates-dir-for,JAVA_LIBRARIES,$(l),,COMMON)/library-res.flata)
+
+$(my_res_package): PRIVATE_RES_FLAT := $(my_res_resources_flat)
+$(my_res_package): PRIVATE_OVERLAY_FLAT := $(my_overlay_resources_flat) $(my_generated_resources_flata) $(my_static_library_resources)
+$(my_res_package): PRIVATE_PROGUARD_OPTIONS_FILE := $(proguard_options_file)
+$(my_res_package) : $(full_android_manifest)
+$(my_res_package) : $(my_res_resources_flat) $(my_overlay_resources_flat) \
+  $(my_generated_resources_flata) $(my_static_library_resources) \
+  $(AAPT2)
+       @echo "AAPT2 link $@"
+       $(call aapt2-link)
+
+$(R_file_stamp) : $(my_res_package) | $(ACP)
+       @echo "target R.java/Manifest.java: $(PRIVATE_MODULE) ($@)"
+       @rm -rf $@ && mkdir -p $(dir $@)
+       $(call find-generated-R.java)
+
+$(proguard_options_file) : $(my_res_package)
+
+resource_export_package :=
+ifdef LOCAL_EXPORT_PACKAGE_RESOURCES
+# Put this module's resources into a PRODUCT-agnositc package that
+# other packages can use to build their own PRODUCT-agnostic R.java (etc.)
+# files.
+resource_export_package := $(intermediates.COMMON)/package-export.apk
+$(R_file_stamp) : $(resource_export_package)
+
+$(resource_export_package) : $(my_res_package) | $(ACP)
+       @echo "target Export Resources: $(PRIVATE_MODULE) $(@)"
+       $(copy-file-to-new-target)
+
+endif
index 582bad4..b945ea9 100644 (file)
@@ -22,9 +22,12 @@ my_full_libs_manifest_deps += $(foreach lib, $(LOCAL_STATIC_JAVA_AAR_LIBRARIES),
 my_full_libs_manifest_files += $(foreach lib, $(LOCAL_STATIC_JAVA_AAR_LIBRARIES),\
   $(call intermediates-dir-for,JAVA_LIBRARIES,$(lib),,COMMON)/aar/AndroidManifest.xml)
 
+# With USE_AAPT2, we'll link in the built resource from the AAR.
+ifndef USE_AAPT2
 LOCAL_RESOURCE_DIR += $(foreach lib, $(LOCAL_STATIC_JAVA_AAR_LIBRARIES),\
   $(call intermediates-dir-for,JAVA_LIBRARIES,$(lib),,COMMON)/aar/res)
-endif
+endif  # USE_AAPT2
+endif  # LOCAL_STATIC_JAVA_AAR_LIBRARIES
 
 # Set up rules to merge library manifest files
 ifdef my_full_libs_manifest_files
index 7e33660..dbcd563 100644 (file)
@@ -304,7 +304,7 @@ ifneq ($(strip $(HOST_ACP_UNAVAILABLE)),)
   LOCAL_ACP_UNAVAILABLE := $(strip $(HOST_ACP_UNAVAILABLE))
 endif
 
-ifndef LOCAL_UNINSTALLABLE_MODULE
+ifneq (true,$(LOCAL_UNINSTALLABLE_MODULE))
   # Define a copy rule to install the module.
   # acp and libraries that it uses can't use acp for
   # installation;  hence, LOCAL_ACP_UNAVAILABLE.
@@ -366,6 +366,50 @@ endif
 endif
 
 ###########################################################
+## Compatibiliy suite files.
+###########################################################
+ifdef LOCAL_COMPATIBILITY_SUITE
+ifneq ($(words $(LOCAL_COMPATIBILITY_SUITE)),1)
+$(error $(LOCAL_PATH):$(LOCAL_MODULE) LOCAL_COMPATIBILITY_SUITE can be only one name)
+endif
+
+# The module itself.
+my_compat_dist := \
+  $(LOCAL_BUILT_MODULE):$(COMPATIBILITY_TESTCASES_OUT_$(LOCAL_COMPATIBILITY_SUITE))/$(my_installed_module_stem)
+
+# Make sure we only add the files once for multilib modules.
+ifndef $(my_prefix)$(LOCAL_MODULE_CLASS)_$(LOCAL_MODULE)_compat_files
+$(my_prefix)$(LOCAL_MODULE_CLASS)_$(LOCAL_MODULE)_compat_files := true
+
+# LOCAL_COMPATIBILITY_SUPPORT_FILES is a list of <src>[:<dest>].
+my_compat_dist += $(foreach f, $(LOCAL_COMPATIBILITY_SUPPORT_FILES),\
+  $(eval p := $(subst :,$(space),$(f)))\
+  $(eval s := $(LOCAL_PATH)/$(word 1,$(p)))\
+  $(eval d := $(COMPATIBILITY_TESTCASES_OUT_$(LOCAL_COMPATIBILITY_SUITE))/$(or $(word 2,$(p)),$(word 1,$(p))))\
+  $(s):$(d))
+
+ifneq (,$(wildcard $(LOCAL_PATH)/AndroidTest.xml))
+my_compat_dist += \
+  $(LOCAL_PATH)/AndroidTest.xml:$(COMPATIBILITY_TESTCASES_OUT_$(LOCAL_COMPATIBILITY_SUITE))/$(LOCAL_MODULE).config
+endif
+
+ifneq (,$(wildcard $(LOCAL_PATH)/DynamicConfig.xml))
+my_compat_dist += \
+  $(LOCAL_PATH)/DynamicConfig.xml:$(COMPATIBILITY_TESTCASES_OUT_$(LOCAL_COMPATIBILITY_SUITE))/$(LOCAL_MODULE).dynamic
+endif
+endif # $(my_prefix)$(LOCAL_MODULE_CLASS)_$(LOCAL_MODULE)_compat_files
+
+my_compat_files := $(call copy-many-files, $(my_compat_dist))
+
+COMPATIBILITY.$(LOCAL_COMPATIBILITY_SUITE).FILES := \
+  $(COMPATIBILITY.$(LOCAL_COMPATIBILITY_SUITE).FILES) \
+  $(my_compat_files)
+
+# Copy over the compatibility files when user runs mm/mmm.
+$(my_register_name) : $(my_compat_files)
+endif  # LOCAL_COMPATIBILITY_SUITE
+
+###########################################################
 ## Register with ALL_MODULES
 ###########################################################
 
index f33f676..e0ecc94 100644 (file)
@@ -217,11 +217,13 @@ ifdef LOCAL_IS_HOST_MODULE
         my_clang := true
     endif
     endif
-# Add option to make clang the default for device build
-else ifeq ($(USE_CLANG_PLATFORM_BUILD),true)
+# Add option to make gcc the default for device build
+else ifeq ($(USE_CLANG_PLATFORM_BUILD),false)
     ifeq ($(my_clang),)
-        my_clang := true
+        my_clang := false
     endif
+else ifeq ($(my_clang),)
+    my_clang := true
 endif
 
 my_cpp_std_version := -std=gnu++14
@@ -549,7 +551,7 @@ renderscript_target_api := $(LOCAL_RENDERSCRIPT_TARGET_API)
 else
 ifneq (,$(LOCAL_SDK_VERSION))
 # Set target-api for LOCAL_SDK_VERSIONs other than current.
-ifneq (,$(filter-out current system_current, $(LOCAL_SDK_VERSION)))
+ifneq (,$(filter-out current system_current test_current, $(LOCAL_SDK_VERSION)))
 renderscript_target_api := $(LOCAL_SDK_VERSION)
 endif
 endif  # LOCAL_SDK_VERSION is set
index 49e56c4..069fbf9 100644 (file)
@@ -83,6 +83,7 @@ LOCAL_DROIDDOC_ASSET_DIR:=
 LOCAL_DROIDDOC_CUSTOM_ASSET_DIR:=
 LOCAL_DROIDDOC_OPTIONS:=
 LOCAL_DROIDDOC_HTML_DIR:=
+LOCAL_DROIDDOC_STUB_OUT_DIR:=
 LOCAL_ADDITIONAL_HTML_DIR:=
 LOCAL_ASSET_DIR:=
 LOCAL_RESOURCE_DIR:=
@@ -145,6 +146,8 @@ LOCAL_OEM_MODULE:=
 LOCAL_ODM_MODULE:=
 LOCAL_PRIVILEGED_MODULE:=
 LOCAL_MODULE_OWNER:=
+LOCAL_COMPATIBILITY_SUITE:=
+LOCAL_COMPATIBILITY_SUPPORT_FILES:=
 LOCAL_CTS_TEST_PACKAGE:=
 LOCAL_CTS_TEST_RUNNER:=
 LOCAL_CLANG:=
@@ -184,9 +187,11 @@ LOCAL_DPI_VARIANTS:=
 LOCAL_DPI_FILE_STEM:=
 LOCAL_SANITIZE:=
 LOCAL_SANITIZE_RECOVER:=
+LOCAL_DATA_BINDING:=
 LOCAL_DBUS_PROXY_PREFIX:=
 LOCAL_INIT_RC:=
 LOCAL_MODULE_HOST_OS:=
+LOCAL_FINDBUGS_FLAGS:=
 LOCAL_NOTICE_FILE:=
 
 # arch specific variables
@@ -337,6 +342,7 @@ LOCAL_CLANG_32:=
 LOCAL_CLANG_64:=
 LOCAL_INIT_RC_32:=
 LOCAL_INIT_RC_64:=
+LOCAL_JAVA_LANGUAGE_VERSION:=
 
 # Trim MAKEFILE_LIST so that $(call my-dir) doesn't need to
 # iterate over thousands of entries every time.
index 70dae13..7f66ea8 100644 (file)
@@ -14,7 +14,7 @@ ifndef ANDROID_COMPILE_WITH_JACK
 ANDROID_COMPILE_WITH_JACK := true
 endif
 
-common_jdk_flags := -source 1.7 -target 1.7 -Xmaxerrs 9999999
+common_jdk_flags := -Xmaxerrs 9999999
 
 # Use the indexer wrapper to index the codebase instead of the javac compiler
 ifeq ($(ALTERNATE_JAVAC),)
index f6bd852..51394c6 100644 (file)
@@ -23,6 +23,7 @@ mac_sdk_versions_installed := $(shell xcodebuild -showsdks | grep macosx | sed -
 mac_sdk_version := $(firstword $(filter $(mac_sdk_versions_installed), $(mac_sdk_versions_supported)))
 ifeq ($(mac_sdk_version),)
 mac_sdk_version := $(firstword $(mac_sdk_versions_supported))
+$(warning none of the installed SDKs ($mac_sdk_versions_installed) match supported versions ($(mac_sdk_versions_supported)), trying $(mac_sdk_version))
 endif
 endif
 
@@ -32,6 +33,7 @@ mac_sdk_path := $(shell xcode-select -print-path)
 mac_sdk_root := $(mac_sdk_path)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$(mac_sdk_version).sdk
 ifeq ($(wildcard $(mac_sdk_root)),)
 # try legacy /Developer/SDKs/MacOSX10.?.sdk
+$(warning no SDK $(mac_sdk_version) at $(mac_sdk_root), trying legacy dir)
 mac_sdk_root := /Developer/SDKs/MacOSX$(mac_sdk_version).sdk
 endif
 ifeq ($(wildcard $(mac_sdk_root)),)
index 0f19dea..b1fc0a5 100644 (file)
@@ -35,6 +35,11 @@ backslash := $(patsubst %a,%,$(backslash))
 # only has an effect on python 2.6 and above.
 export PYTHONDONTWRITEBYTECODE := 1
 
+ifneq ($(filter --color=always, $(GREP_OPTIONS)),)
+$(warning The build system needs unmodified output of grep.)
+$(error Please remove --color=always from your  $$GREP_OPTIONS)
+endif
+
 # Standard source directories.
 SRC_DOCS:= $(TOPDIR)docs
 # TODO: Enforce some kind of layering; only add include paths
@@ -57,6 +62,7 @@ SRC_SERVERS:= $(TOPDIR)servers
 SRC_TARGET_DIR := $(TOPDIR)build/target
 SRC_API_DIR := $(TOPDIR)prebuilts/sdk/api
 SRC_SYSTEM_API_DIR := $(TOPDIR)prebuilts/sdk/system-api
+SRC_TEST_API_DIR := $(TOPDIR)prebuilts/sdk/test-api
 
 # Some specific paths to tools
 SRC_DROIDDOC_DIR := $(TOPDIR)build/tools/droiddoc
@@ -397,6 +403,7 @@ endif
 ACP := $(HOST_OUT_EXECUTABLES)/acp
 AIDL := $(HOST_OUT_EXECUTABLES)/aidl
 AAPT := $(HOST_OUT_EXECUTABLES)/aapt
+AAPT2 := $(HOST_OUT_EXECUTABLES)/aapt2
 ZIPALIGN := $(HOST_OUT_EXECUTABLES)/zipalign
 SIGNAPK_JAR := $(HOST_OUT_JAVA_LIBRARIES)/signapk$(COMMON_JAVA_PACKAGE_SUFFIX)
 SIGNAPK_JNI_LIBRARY_PATH := $(HOST_OUT_SHARED_LIBRARIES)
@@ -416,6 +423,7 @@ prebuilt_sdk_tools_bin := $(prebuilt_sdk_tools)/$(HOST_OS)/bin
 ACP := $(prebuilt_sdk_tools_bin)/acp
 AIDL := $(prebuilt_sdk_tools_bin)/aidl
 AAPT := $(prebuilt_sdk_tools_bin)/aapt
+AAPT2 := $(prebuilt_sdk_tools_bin)/aapt2
 ZIPALIGN := $(prebuilt_sdk_tools_bin)/zipalign
 SIGNAPK_JAR := $(prebuilt_sdk_tools)/lib/signapk$(COMMON_JAVA_PACKAGE_SUFFIX)
 # Use 64-bit libraries unconditionally because 32-bit JVMs are no longer supported
@@ -486,6 +494,7 @@ MKTARBALL := build/tools/mktarball.sh
 TUNE2FS := $(HOST_OUT_EXECUTABLES)/tune2fs$(HOST_EXECUTABLE_SUFFIX)
 E2FSCK := $(HOST_OUT_EXECUTABLES)/e2fsck$(HOST_EXECUTABLE_SUFFIX)
 JARJAR := $(HOST_OUT_JAVA_LIBRARIES)/jarjar.jar
+DATA_BINDING_COMPILER := $(HOST_OUT_JAVA_LIBRARIES)/databinding-compiler.jar
 
 ifeq ($(ANDROID_COMPILE_WITH_JACK),true)
 DEFAULT_JACK_ENABLED:=full
@@ -500,7 +509,7 @@ endif
 # Turn off jack warnings by default.
 DEFAULT_JACK_EXTRA_ARGS += --verbose error
 
-JILL := java -Xmx3500m -jar $(JILL_JAR)
+JILL := java -jar $(JILL_JAR)
 PROGUARD := external/proguard/bin/proguard.sh
 JAVATAGS := build/tools/java-event-log-tags.py
 RMTYPEDEFS := $(HOST_OUT_EXECUTABLES)/rmtypedefs
@@ -766,13 +775,15 @@ TARGET_AVAILABLE_SDK_VERSIONS := $(call numerically_sort,\
     $(patsubst $(HISTORICAL_SDK_VERSIONS_ROOT)/%/android.jar,%, \
     $(wildcard $(HISTORICAL_SDK_VERSIONS_ROOT)/*/android.jar)))
 
-# We don't have prebuilt system_current SDK yet.
-TARGET_AVAILABLE_SDK_VERSIONS := $(TARGET_AVAILABLE_SDK_VERSIONS)
+# We don't have prebuilt test_current SDK yet.
+TARGET_AVAILABLE_SDK_VERSIONS := test_current $(TARGET_AVAILABLE_SDK_VERSIONS)
 
 INTERNAL_PLATFORM_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/public_api.txt
 INTERNAL_PLATFORM_REMOVED_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/removed.txt
 INTERNAL_PLATFORM_SYSTEM_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/system-api.txt
 INTERNAL_PLATFORM_SYSTEM_REMOVED_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/system-removed.txt
+INTERNAL_PLATFORM_TEST_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/test-api.txt
+INTERNAL_PLATFORM_TEST_REMOVED_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/test-removed.txt
 
 # This is the standard way to name a directory containing prebuilt target
 # objects. E.g., prebuilt/$(TARGET_PREBUILT_TAG)/libc.so
index 6b1d8fc..7772b15 100644 (file)
@@ -142,27 +142,11 @@ $(strip \
 endef
 
 ###########################################################
-## Remove any makefiles that are being handled by soong
-###########################################################
-ifeq ($(USE_SOONG),true)
-define filter-soong-makefiles
-$(foreach mk,$(1),\
-  $(if $(wildcard $(patsubst %/Android.mk,%/Android.bp,$(mk))),\
-    $(info skipping $(mk) ...),\
-    $(mk)))
-endef
-else
-define filter-soong-makefiles
-$(1)
-endef
-endif
-
-###########################################################
 ## Retrieve a list of all makefiles immediately below some directory
 ###########################################################
 
 define all-makefiles-under
-$(sort $(call filter-soong-makefiles,$(wildcard $(1)/*/Android.mk)))
+$(sort $(wildcard $(1)/*/Android.mk))
 endef
 
 ###########################################################
@@ -173,9 +157,8 @@ endef
 # $(1): directory to search under
 # Ignores $(1)/Android.mk
 define first-makefiles-under
-$(call filter-soong-makefiles,\
-  $(shell build/tools/findleaves.py $(FIND_LEAVES_EXCLUDES) \
-        --mindepth=2 $(1) Android.mk))
+$(shell build/tools/findleaves.py $(FIND_LEAVES_EXCLUDES) \
+        --mindepth=2 $(1) Android.mk)
 endef
 
 ###########################################################
@@ -195,8 +178,7 @@ endef
 
 # $(1): List of directories to look for under this directory
 define all-named-subdir-makefiles
-$(sort $(call filter-soong-makefiles,\
-  $(wildcard $(addsuffix /Android.mk, $(addprefix $(call my-dir)/,$(1))))))
+$(sort $(wildcard $(addsuffix /Android.mk, $(addprefix $(call my-dir)/,$(1)))))
 endef
 
 ###########################################################
@@ -1813,6 +1795,78 @@ $(hide) $(AAPT) package $(PRIVATE_AAPT_FLAGS) -m \
     --skip-symbols-without-default-localization
 endef
 
+# Search for generated R.java/Manifest.java, copy the found R.java as $@.
+# Also copy them to a central 'R' directory to make it easier to add the files to an IDE.
+define find-generated-R.java
+$(hide) for GENERATED_MANIFEST_FILE in `find $(PRIVATE_SOURCE_INTERMEDIATES_DIR) \
+  -name Manifest.java 2> /dev/null`; do \
+    dir=`awk '/package/{gsub(/\./,"/",$$2);gsub(/;/,"",$$2);print $$2;exit}' $$GENERATED_MANIFEST_FILE`; \
+    mkdir -p $(TARGET_COMMON_OUT_ROOT)/R/$$dir; \
+    $(ACP) -fp $$GENERATED_MANIFEST_FILE $(TARGET_COMMON_OUT_ROOT)/R/$$dir; \
+  done;
+$(hide) for GENERATED_R_FILE in `find $(PRIVATE_SOURCE_INTERMEDIATES_DIR) \
+  -name R.java 2> /dev/null`; do \
+    dir=`awk '/package/{gsub(/\./,"/",$$2);gsub(/;/,"",$$2);print $$2;exit}' $$GENERATED_R_FILE`; \
+    mkdir -p $(TARGET_COMMON_OUT_ROOT)/R/$$dir; \
+    $(ACP) -fp $$GENERATED_R_FILE $(TARGET_COMMON_OUT_ROOT)/R/$$dir \
+      || exit 31; \
+    $(ACP) -fp $$GENERATED_R_FILE $@ || exit 32; \
+  done;
+@# Ensure that the target file is always created, i.e. also in case we did not
+@# enter the GENERATED_R_FILE-loop above. This avoids unnecessary rebuilding.
+$(hide) touch $@
+endef
+
+###########################################################
+# AAPT2 compilation and link
+###########################################################
+define aapt2-compile-one-resource-file
+@mkdir -p $(dir $@)
+$(hide) $(AAPT2) compile -o $(dir $@) $(PRIVATE_AAPT2_CFLAGS) --legacy $<
+endef
+
+define aapt2-compile-one-resource-dir
+@mkdir -p $(dir $@)
+$(hide) $(AAPT2) compile -o $@ --dir $(PRIVATE_SOURCE_RES_DIR) \
+  $(PRIVATE_AAPT2_CFLAGS) --legacy
+endef
+
+# Set up rule to compile one resource file with aapt2.
+# Must be called with $(eval).
+# $(1): the source file
+# $(2): the output file
+define aapt2-compile-one-resource-file-rule
+$(2) : $(1) $(AAPT2)
+       @echo "AAPT2 compile $$@ <- $$<"
+       $$(call aapt2-compile-one-resource-file)
+endef
+
+# Convert input resource file path to output file path.
+# values-[config]/<file>.xml -> values-[config]_<file>.arsc.flat;
+# For other resource file, just replace the last "/" with "_" and
+# add .flat extension.
+#
+# $(1): the input resource file path
+# $(2): the base dir of the output file path
+# Returns: the compiled output file path
+define aapt2-compiled-resource-out-file
+$(eval _p_w := $(strip $(subst /,$(space),$(dir $(1)))))$(2)/$(subst $(space),/,$(_p_w))_$(if $(filter values%,$(lastword $(_p_w))),$(patsubst %.xml,%.arsc,$(notdir $(1))),$(notdir $(1))).flat
+endef
+
+define aapt2-link
+$(hide) $(AAPT2) link -o $@ \
+  $(PRIVATE_AAPT_FLAGS) \
+  $(addprefix --manifest ,$(PRIVATE_ANDROID_MANIFEST)) \
+  $(addprefix -I ,$(PRIVATE_AAPT_INCLUDES)) \
+  $(addprefix --java ,$(PRIVATE_SOURCE_INTERMEDIATES_DIR)) \
+  $(addprefix --proguard ,$(PRIVATE_PROGUARD_OPTIONS_FILE)) \
+  $(addprefix --min-sdk-version ,$(PRIVATE_DEFAULT_APP_TARGET_SDK)) \
+  $(addprefix --target-sdk-version ,$(PRIVATE_DEFAULT_APP_TARGET_SDK)) \
+  $(addprefix -R , $(PRIVATE_OVERLAY_FLAT)) \
+  $(PRIVATE_RES_FLAT)
+endef
+
+###########################################################
 xlint_unchecked := -Xlint:unchecked
 
 # emit-line, <word list>, <output file>
index e0dde01..de0b80a 100644 (file)
@@ -19,6 +19,17 @@ DEXPREOPT_BOOT_JAR_DIR_FULL_PATH := $(DEXPREOPT_PRODUCT_DIR_FULL_PATH)/$(DEXPREO
 # The default value for LOCAL_DEX_PREOPT
 DEX_PREOPT_DEFAULT ?= true
 
+# The default values for pre-opting: always preopt PIC.
+# Conditional to building on linux, as dex2oat currently does not work on darwin.
+# Conditional to building a non-eng build, as it currently negatively affects
+# some development workflows.
+ifneq ($(TARGET_BUILD_VARIANT),eng)
+  ifeq ($(HOST_OS),linux)
+    WITH_DEXPREOPT_PIC ?= true
+    WITH_DEXPREOPT ?= true
+  endif
+endif
+
 # $(1): the .jar or .apk to remove classes.dex
 define dexpreopt-remove-classes.dex
 $(hide) zip --quiet --delete $(1) classes.dex; \
index b2a3d64..6bae25d 100644 (file)
@@ -16,7 +16,7 @@ $(built_dpi_apk): PRIVATE_ANDROID_MANIFEST := $(full_android_manifest)
 $(built_dpi_apk): PRIVATE_RESOURCE_DIR := $(LOCAL_RESOURCE_DIR)
 $(built_dpi_apk): PRIVATE_ASSET_DIR := $(LOCAL_ASSET_DIR)
 $(built_dpi_apk): PRIVATE_AAPT_INCLUDES := $(all_library_res_package_exports)
-ifneq (,$(filter-out current system_current, $(LOCAL_SDK_VERSION)))
+ifneq (,$(filter-out current system_current test_current, $(LOCAL_SDK_VERSION)))
 $(built_dpi_apk): PRIVATE_DEFAULT_APP_TARGET_SDK := $(LOCAL_SDK_VERSION)
 else
 $(built_dpi_apk): PRIVATE_DEFAULT_APP_TARGET_SDK := $(DEFAULT_APP_TARGET_SDK)
index 1b65611..f143579 100644 (file)
@@ -68,6 +68,9 @@ ifneq ($(LOCAL_SDK_VERSION),)
   else ifeq ($(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS),system_current)
     LOCAL_JAVA_LIBRARIES := android_system_stubs_current $(LOCAL_JAVA_LIBRARIES)
     $(full_target): PRIVATE_BOOTCLASSPATH := $(call java-lib-files, android_system_stubs_current)
+  else ifeq ($(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS),test_current)
+    LOCAL_JAVA_LIBRARIES := android_test_stubs_current $(LOCAL_JAVA_LIBRARIES)
+    $(full_target): PRIVATE_BOOTCLASSPATH := $(call java-lib-files, android_test_stubs_current)
   else
     LOCAL_JAVA_LIBRARIES := sdk_v$(LOCAL_SDK_VERSION) $(LOCAL_JAVA_LIBRARIES)
     $(full_target): PRIVATE_BOOTCLASSPATH := $(call java-lib-files, sdk_v$(LOCAL_SDK_VERSION))
@@ -99,6 +102,7 @@ endif
 
 $(full_target): PRIVATE_OUT_DIR := $(out_dir)
 $(full_target): PRIVATE_DROIDDOC_OPTIONS := $(LOCAL_DROIDDOC_OPTIONS)
+$(full_target): PRIVATE_STUB_OUT_DIR := $(LOCAL_DROIDDOC_STUB_OUT_DIR)
 
 # Lists the input files for the doc build into a text file
 # suitable for the @ syntax of javadoc.
@@ -165,6 +169,7 @@ $(full_target): \
         $(LOCAL_ADDITIONAL_DEPENDENCIES)
        @echo Docs droiddoc: $(PRIVATE_OUT_DIR)
        $(hide) mkdir -p $(dir $@)
+       $(addprefix $(hide) rm -rf ,$(PRIVATE_STUB_OUT_DIR))
        $(call prepare-doc-source-list,$(PRIVATE_SRC_LIST_FILE),$(PRIVATE_JAVA_FILES), \
                        $(PRIVATE_SOURCE_INTERMEDIATES_DIR) $(PRIVATE_ADDITIONAL_JAVA_DIR))
        $(hide) ( \
@@ -186,6 +191,7 @@ $(full_target): \
                 -d $(PRIVATE_OUT_DIR) \
                 $(PRIVATE_CURRENT_BUILD) $(PRIVATE_CURRENT_TIME) \
                 $(PRIVATE_DROIDDOC_OPTIONS) \
+                $(addprefix -stubs ,$(PRIVATE_STUB_OUT_DIR)) \
         && touch -f $@ \
     ) || (rm -rf $(PRIVATE_OUT_DIR) $(PRIVATE_SRC_LIST_FILE); exit 45)
 
index 683b8b8..550e07a 100644 (file)
@@ -28,8 +28,7 @@ include $(BUILD_SYSTEM)/host_java_library_common.mk
 #######################################
 
 ifneq ($(LOCAL_NO_STANDARD_LIBRARIES),true)
-  LOCAL_JAVA_LIBRARIES +=  core-oj-hostdex
-  LOCAL_JAVA_LIBRARIES +=  core-libart-hostdex
+  LOCAL_JAVA_LIBRARIES += core-oj-hostdex core-libart-hostdex
 endif
 
 full_classes_compiled_jar := $(intermediates.COMMON)/classes-full-debug.jar
index 47ca002..29a1aba 100644 (file)
@@ -24,8 +24,7 @@ ifeq ($(HOST_OS),linux)
 LOCAL_UNINSTALLABLE_MODULE := true
 LOCAL_IS_STATIC_JAVA_LIBRARY := true
 USE_CORE_LIB_BOOTCLASSPATH := true
-LOCAL_JAVA_LIBRARIES += core-oj-hostdex
-LOCAL_JAVA_LIBRARIES += core-libart-hostdex
+LOCAL_JAVA_LIBRARIES += core-oj-hostdex core-libart-hostdex
 
 intermediates.COMMON := $(call intermediates-dir-for,JAVA_LIBRARIES,$(LOCAL_MODULE),true,COMMON,)
 full_classes_jack := $(intermediates.COMMON)/classes.jack
index 9b8ee12..d1f4635 100644 (file)
@@ -31,6 +31,8 @@ ifneq ($(LOCAL_SDK_VERSION),)
         LOCAL_JAVA_LIBRARIES := android_stubs_current $(LOCAL_JAVA_LIBRARIES)
       else ifeq ($(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS),system_current)
         LOCAL_JAVA_LIBRARIES := android_system_stubs_current $(LOCAL_JAVA_LIBRARIES)
+      else ifeq ($(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS),test_current)
+        LOCAL_JAVA_LIBRARIES := android_test_stubs_current $(LOCAL_JAVA_LIBRARIES)
       else
         LOCAL_JAVA_LIBRARIES := sdk_v$(LOCAL_SDK_VERSION) $(LOCAL_JAVA_LIBRARIES)
       endif
@@ -143,6 +145,7 @@ renderscript_sources := $(filter %.rs %.fs,$(LOCAL_SRC_FILES))
 # Because names of the java files from RenderScript are unknown until the
 # .rs file(s) are compiled, we have to depend on a timestamp file.
 RenderScript_file_stamp :=
+rs_generated_res_dir :=
 rs_compatibility_jni_libs :=
 ifneq ($(renderscript_sources),)
 renderscript_sources_fullpath := $(addprefix $(LOCAL_PATH)/, $(renderscript_sources))
@@ -157,7 +160,7 @@ ifneq (,$(LOCAL_RENDERSCRIPT_TARGET_API))
 else
   ifneq (,$(LOCAL_SDK_VERSION))
     # Set target-api for LOCAL_SDK_VERSIONs other than current.
-    ifneq (,$(filter-out current system_current, $(LOCAL_SDK_VERSION)))
+    ifneq (,$(filter-out current system_current test_current, $(LOCAL_SDK_VERSION)))
       renderscript_target_api := $(LOCAL_SDK_VERSION)
     endif
   endif  # LOCAL_SDK_VERSION is set
@@ -182,7 +185,7 @@ renderscript_flags := -Wall -Werror
 renderscript_flags += $(LOCAL_RENDERSCRIPT_FLAGS)
 
 # prepend the RenderScript system include path
-ifneq ($(filter-out current system_current,$(LOCAL_SDK_VERSION))$(if $(TARGET_BUILD_APPS),$(filter current system_current,$(LOCAL_SDK_VERSION))),)
+ifneq ($(filter-out current system_current test_current,$(LOCAL_SDK_VERSION))$(if $(TARGET_BUILD_APPS),$(filter current system_current test_current,$(LOCAL_SDK_VERSION))),)
 # if a numeric LOCAL_SDK_VERSION, or current LOCAL_SDK_VERSION with TARGET_BUILD_APPS
 LOCAL_RENDERSCRIPT_INCLUDES := \
     $(HISTORICAL_SDK_VERSIONS_ROOT)/renderscript/clang-include \
@@ -275,7 +278,8 @@ endif
 
 LOCAL_INTERMEDIATE_TARGETS += $(RenderScript_file_stamp)
 # Make sure the generated resource will be added to the apk.
-LOCAL_RESOURCE_DIR := $(LOCAL_INTERMEDIATE_SOURCE_DIR)/renderscript/res $(LOCAL_RESOURCE_DIR)
+rs_generated_res_dir := $(renderscript_intermediate.COMMON)/res
+LOCAL_RESOURCE_DIR := $(rs_generated_res_dir) $(LOCAL_RESOURCE_DIR)
 endif
 
 
@@ -290,7 +294,7 @@ aidl_sources := $(addprefix $(LOCAL_PATH)/, $(aidl_sources))
 
 aidl_preprocess_import :=
 ifdef LOCAL_SDK_VERSION
-ifneq ($(filter current system_current, $(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS)),)
+ifneq ($(filter current system_current test_current, $(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS)),)
   # LOCAL_SDK_VERSION is current and no TARGET_BUILD_APPS
   aidl_preprocess_import := $(TARGET_OUT_COMMON_INTERMEDIATES)/framework.aidl
 else
@@ -476,7 +480,7 @@ my_support_library_sdk_raise :=
 ifneq (,$(filter android-support-%,$(LOCAL_STATIC_JAVA_LIBRARIES)))
 ifdef LOCAL_SDK_VERSION
 ifdef TARGET_BUILD_APPS
-ifeq (,$(filter current system_current, $(LOCAL_SDK_VERSION)))
+ifeq (,$(filter current system_current test_current, $(LOCAL_SDK_VERSION)))
   my_support_library_sdk_raise := $(call java-lib-files, sdk_vcurrent)
 endif
 else
@@ -598,13 +602,13 @@ ifneq ($(GENERATE_DEX_DEBUG),)
 endif
 
 findbugs_xml := $(intermediates.COMMON)/findbugs.xml
-$(findbugs_xml) : PRIVATE_AUXCLASSPATH := $(addprefix -auxclasspath ,$(strip \
-                                                               $(call normalize-path-list,$(filter %.jar,\
-                                                                               $(full_java_libs)))))
-$(findbugs_xml) : $(full_classes_jar)
+$(findbugs_xml): PRIVATE_AUXCLASSPATH := $(addprefix -auxclasspath ,$(strip \
+    $(call normalize-path-list,$(filter %.jar,$(full_java_libs)))))
+$(findbugs_xml): PRIVATE_FINDBUGS_FLAGS := $(LOCAL_FINDBUGS_FLAGS)
+$(findbugs_xml) : $(full_classes_jar) $(filter %.xml, $(LOCAL_FINDBUGS_FLAGS))
        @echo Findbugs: $@
        $(hide) $(FINDBUGS) -textui -effort:min -xml:withMessages \
-               $(PRIVATE_AUXCLASSPATH) \
+               $(PRIVATE_AUXCLASSPATH) $(PRIVATE_FINDBUGS_FLAGS) \
                $< \
                > $@
 
index aee3193..08e5ee7 100644 (file)
@@ -1,6 +1,14 @@
 # Common to host and target Java modules.
 
 ###########################################################
+## Java version
+###########################################################
+ifeq (,$(LOCAL_JAVA_LANGUAGE_VERSION))
+  LOCAL_JAVA_LANGUAGE_VERSION := 1.7
+endif
+LOCAL_JAVACFLAGS += -source $(LOCAL_JAVA_LANGUAGE_VERSION) -target $(LOCAL_JAVA_LANGUAGE_VERSION)
+
+###########################################################
 ## .proto files: Compile proto files to .java
 ###########################################################
 proto_sources := $(filter %.proto,$(LOCAL_SRC_FILES))
@@ -145,9 +153,11 @@ ifeq ($(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS),current)
 my_bootclasspath := $(call java-lib-files,android_stubs_current)
 else ifeq ($(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS),system_current)
 my_bootclasspath := $(call java-lib-files,android_system_stubs_current)
+else ifeq ($(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS),test_current)
+my_bootclasspath := $(call java-lib-files,android_test_stubs_current)
 else
 my_bootclasspath := $(call java-lib-files,sdk_v$(LOCAL_SDK_VERSION))
-endif # current or system_current
+endif # current, system_current, or test_current
 endif # LOCAL_SDK_VERSION
 $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_BOOTCLASSPATH := -bootclasspath $(my_bootclasspath)
 
@@ -265,6 +275,8 @@ ALL_MODULES.$(my_register_name).INTERMEDIATE_SOURCE_DIR := \
 ifdef LOCAL_JACK_ENABLED
 ifdef need_compile_java
 
+LOCAL_JACK_FLAGS += -D jack.java.source.version=$(LOCAL_JAVA_LANGUAGE_VERSION)
+
 full_static_jack_libs := \
     $(foreach lib,$(LOCAL_STATIC_JAVA_LIBRARIES), \
       $(call intermediates-dir-for, \
@@ -277,7 +289,7 @@ ifeq ($(LOCAL_SDK_VERSION),)
 ifeq ($(LOCAL_NO_STANDARD_LIBRARIES),true)
 my_bootclasspath :=
 else
-my_bootclasspath :=  $(call jack-lib-files,core-oj):$(call jack-lib-files,core-libart)
+my_bootclasspath := $(call jack-lib-files,core-oj core-libart)
 endif
 else  # LOCAL_SDK_VERSION
 ifeq ($(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS),current)
@@ -285,9 +297,11 @@ ifeq ($(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS),current)
 my_bootclasspath := $(call jack-lib-files,android_stubs_current)
 else ifeq ($(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS),system_current)
 my_bootclasspath := $(call jack-lib-files,android_system_stubs_current)
+else ifeq ($(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS),test_current)
+my_bootclasspath := $(call jack-lib-files,android_test_stubs_current)
 else
 my_bootclasspath :=$(call jack-lib-files,sdk_v$(LOCAL_SDK_VERSION))
-endif # current or system_current
+endif # current, system_current, or test_current
 endif # LOCAL_SDK_VERSION
 $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_BOOTCLASSPATH_JAVA_LIBRARIES := $(my_bootclasspath)
 
@@ -304,7 +318,7 @@ ifeq ($(USE_CORE_LIB_BOOTCLASSPATH),true)
 ifeq ($(LOCAL_NO_STANDARD_LIBRARIES),true)
 my_bootclasspath :=
 else
-my_bootclasspath := $(call jack-lib-files,core-oj-hostdex,$(LOCAL_IS_HOST_MODULE)):$(call jack-lib-files,core-libart-hostdex,$(LOCAL_IS_HOST_MODULE))
+my_bootclasspath := $(call jack-lib-files,core-oj-hostdex core-libart-hostdex,$(LOCAL_IS_HOST_MODULE))
 endif
 $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_BOOTCLASSPATH_JAVA_LIBRARIES := $(my_bootclasspath)
 full_shared_jack_libs := $(call jack-lib-files,$(LOCAL_JAVA_LIBRARIES),$(LOCAL_IS_HOST_MODULE))
index 923e677..ae53c37 100644 (file)
@@ -223,11 +223,11 @@ endif
 
 # Check for the current jdk
 ifeq ($(requires_openjdk), true)
-# The user asked for java7 openjdk, so check that the host
-# java version is really openjdk
+# The user asked for openjdk, so check that the host
+# java version is really openjdk and not some other JDK.
 ifeq ($(shell echo '$(java_version_str)' | grep -i openjdk),)
 $(info ************************************************************)
-$(info You asked for an OpenJDK 7 build but your version is)
+$(info You asked for an OpenJDK based build but your version is)
 $(info $(java_version_str).)
 $(info ************************************************************)
 $(error stop)
@@ -387,18 +387,6 @@ ifneq (,$(user_variant))
     enable_target_debugging :=
   endif
 
-  # Turn on Dalvik preoptimization for user builds, but only if not
-  # explicitly disabled and the build is running on Linux (since host
-  # Dalvik isn't built for non-Linux hosts).
-  ifeq (,$(WITH_DEXPREOPT))
-    ifeq ($(user_variant),user)
-      ifeq ($(HOST_OS),linux)
-        # TODO: turn on WITH_DEXPREOPT for libart user builds.
-        # WITH_DEXPREOPT := true
-      endif
-    endif
-  endif
-
   # Disallow mock locations by default for user builds
   ADDITIONAL_DEFAULT_PROPERTIES += ro.allow.mock.location=0
 
@@ -434,12 +422,9 @@ ifneq ($(filter ro.setupwizard.mode=ENABLED, $(call collapse-pairs, $(ADDITIONAL
           ro.setupwizard.mode=OPTIONAL
 endif
 ifndef is_sdk_build
-  # Don't verify or compile the image on eng builds to speed startup.
+  # To speedup startup of non-preopted builds, don't verify or compile the boot image.
   ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.image-dex2oat-filter=verify-at-runtime
-  # Don't verify or compile apps on eng builds to speed startup.
-  ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.dex2oat-filter=verify-at-runtime
 endif
-  ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.usejit=true
 endif
 
 ## sdk ##
@@ -544,12 +529,11 @@ ifneq ($(dont_bother),true)
 # --mindepth=2 makes the prunes not work.
 subdir_makefiles := \
        $(shell build/tools/findleaves.py $(FIND_LEAVES_EXCLUDES) $(subdirs) Android.mk)
-
 ifeq ($(USE_SOONG),true)
-subdir_makefiles := $(SOONG_ANDROID_MK) $(call filter-soong-makefiles,$(subdir_makefiles))
+subdir_makefiles := $(SOONG_ANDROID_MK) $(subdir_makefiles)
 endif
 
-$(foreach mk, $(subdir_makefiles),$(info including $(mk) ...)$(eval include $(mk)))
+$(foreach mk, $(subdir_makefiles), $(info including $(mk) ...)$(eval include $(mk)))
 
 endif # dont_bother
 
index 097d801..c1da5ed 100644 (file)
@@ -57,6 +57,9 @@ $(error $(LOCAL_PATH): Package modules may not set LOCAL_MODULE_CLASS)
 endif
 LOCAL_MODULE_CLASS := APPS
 
+intermediates := $(call local-intermediates-dir)
+intermediates.COMMON := $(call local-intermediates-dir,COMMON)
+
 #################################
 include $(BUILD_SYSTEM)/configure_local_jack.mk
 #################################
@@ -112,6 +115,32 @@ ifneq ($(all_assets),)
 need_compile_asset := true
 endif
 
+ifdef USE_AAPT2
+# In aapt2 the last takes precedence.
+my_resource_dirs := $(call reverse-list,$(LOCAL_RESOURCE_DIR))
+my_res_resources :=
+my_overlay_resources :=
+# Treat all but the first directory as overlays.
+my_overlay_resources := $(strip \
+  $(foreach d,$(wordlist 2,999,$(my_resource_dirs)),\
+    $(addprefix $(d)/, \
+        $(call find-subdir-assets,$(d)))))
+
+my_res_dir := $(firstword $(my_resource_dirs))
+my_res_resources := $(strip \
+    $(addprefix $(my_res_dir)/, \
+        $(call find-subdir-assets,$(my_res_dir))))
+
+all_resources := $(strip $(my_res_resources) $(my_overlay_resources))
+
+# The linked resource package.
+my_res_package := $(intermediates)/package-res.apk
+LOCAL_INTERMEDIATE_TARGETS += $(my_res_package)
+
+# Always run aapt2
+need_compile_res := true
+
+else  # USE_AAPT2
 all_resources := $(strip \
     $(foreach dir, $(LOCAL_RESOURCE_DIR), \
       $(addprefix $(dir)/, \
@@ -121,13 +150,14 @@ all_resources := $(strip \
        ) \
      ))
 
+endif  # USE_AAPT2
+
 ifneq ($(all_resources),)
   need_compile_res := true
 endif
 
 all_res_assets := $(strip $(all_assets) $(all_resources))
 
-intermediates.COMMON := $(call local-intermediates-dir,COMMON)
 
 # If no assets or resources were found, clear the directory variables so
 # we don't try to build them.
@@ -214,6 +244,24 @@ endif # LOCAL_EMMA_INSTRUMENT
 
 rs_compatibility_jni_libs :=
 
+ifeq ($(LOCAL_DATA_BINDING),true)
+data_binding_intermediates := $(intermediates.COMMON)/data-binding
+
+LOCAL_JAVACFLAGS += -processorpath $(DATA_BINDING_COMPILER) -s $(data_binding_intermediates)/anno-src
+LOCAL_JACK_FLAGS += --processorpath $(DATA_BINDING_COMPILER)
+
+LOCAL_STATIC_JAVA_LIBRARIES += databinding-baselibrary
+LOCAL_STATIC_JAVA_AAR_LIBRARIES += databinding-library databinding-adapters
+
+data_binding_res_in := $(LOCAL_RESOURCE_DIR)
+data_binding_res_out := $(data_binding_intermediates)/res
+
+# Replace with the processed merged res dir.
+LOCAL_RESOURCE_DIR := $(data_binding_res_out)
+
+LOCAL_AAPT_FLAGS += --auto-add-overlay --extra-packages com.android.databinding.library
+endif  # LOCAL_DATA_BINDING
+
 include $(BUILD_SYSTEM)/android_manifest.mk
 
 #################################
@@ -227,7 +275,7 @@ endif
 
 $(LOCAL_INTERMEDIATE_TARGETS): \
     PRIVATE_ANDROID_MANIFEST := $(full_android_manifest)
-ifneq (,$(filter-out current system_current, $(LOCAL_SDK_VERSION)))
+ifneq (,$(filter-out current system_current test_current, $(LOCAL_SDK_VERSION)))
 $(LOCAL_INTERMEDIATE_TARGETS): \
     PRIVATE_DEFAULT_APP_TARGET_SDK := $(LOCAL_SDK_VERSION)
 else
@@ -235,7 +283,40 @@ $(LOCAL_INTERMEDIATE_TARGETS): \
     PRIVATE_DEFAULT_APP_TARGET_SDK := $(DEFAULT_APP_TARGET_SDK)
 endif
 
+ifeq ($(LOCAL_DATA_BINDING),true)
+data_binding_stamp := $(data_binding_intermediates)/data-binding.stamp
+$(data_binding_stamp): PRIVATE_INTERMEDIATES := $(data_binding_intermediates)
+$(data_binding_stamp): PRIVATE_MANIFEST := $(full_android_manifest)
+# Generate code into $(LOCAL_INTERMEDIATE_SOURCE_DIR) so that the generated .java files
+# will be automatically picked up by function compile-java.
+$(data_binding_stamp): PRIVATE_SRC_OUT := $(LOCAL_INTERMEDIATE_SOURCE_DIR)/data-binding
+$(data_binding_stamp): PRIVATE_XML_OUT := $(data_binding_intermediates)/xml
+$(data_binding_stamp): PRIVATE_RES_OUT := $(data_binding_res_out)
+$(data_binding_stamp): PRIVATE_RES_IN := $(data_binding_res_in)
+$(data_binding_stamp): PRIVATE_ANNO_SRC_DIR := $(data_binding_intermediates)/anno-src
+
+$(data_binding_stamp) : $(all_res_assets) $(full_android_manifest) \
+    $(DATA_BINDING_COMPILER)
+       @echo "Data-binding process: $@"
+       @rm -rf $(PRIVATE_INTERMEDIATES) $(PRIVATE_SRC_OUT) && \
+         mkdir -p $(PRIVATE_INTERMEDIATES) $(PRIVATE_SRC_OUT) \
+             $(PRIVATE_XML_OUT) $(PRIVATE_RES_OUT) $(PRIVATE_ANNO_SRC_DIR)
+       $(hide) java -classpath $(DATA_BINDING_COMPILER) android.databinding.tool.MakeCopy \
+         $(PRIVATE_MANIFEST) $(PRIVATE_SRC_OUT) $(PRIVATE_XML_OUT) $(PRIVATE_RES_OUT) $(PRIVATE_RES_IN)
+       $(hide) touch $@
+
+# Make sure the data-binding process happens before javac and generation of R.java.
+$(R_file_stamp) $(full_classes_compiled_jar) : $(data_binding_stamp)
+# The dependency path when jack is enabled
+$(built_dex_intermediate) : $(data_binding_stamp)
+endif  # LOCAL_DATA_BINDING
+
 ifeq ($(need_compile_res),true)
+ifdef USE_AAPT2
+my_aapt_characteristics := $(TARGET_AAPT_CHARACTERISTICS)
+my_compiled_res_base_dir := $(intermediates)/flat-res
+include $(BUILD_SYSTEM)/aapt2.mk
+else  # USE_AAPT2
 
 # Since we don't know where the real R.java file is going to end up,
 # we need to use another file to stand in its place.  We'll just
@@ -253,23 +334,7 @@ $(R_file_stamp): $(all_res_assets) $(full_android_manifest) $(RenderScript_file_
        @echo "target R.java/Manifest.java: $(PRIVATE_MODULE) ($@)"
        @rm -rf $@ && mkdir -p $(dir $@)
        $(create-resource-java-files)
-       $(hide) for GENERATED_MANIFEST_FILE in `find $(PRIVATE_SOURCE_INTERMEDIATES_DIR) \
-                                       -name Manifest.java 2> /dev/null`; do \
-               dir=`awk '/package/{gsub(/\./,"/",$$2);gsub(/;/,"",$$2);print $$2;exit}' $$GENERATED_MANIFEST_FILE`; \
-               mkdir -p $(TARGET_COMMON_OUT_ROOT)/R/$$dir; \
-               $(ACP) -fp $$GENERATED_MANIFEST_FILE $(TARGET_COMMON_OUT_ROOT)/R/$$dir; \
-       done;
-       $(hide) for GENERATED_R_FILE in `find $(PRIVATE_SOURCE_INTERMEDIATES_DIR) \
-                                       -name R.java 2> /dev/null`; do \
-               dir=`awk '/package/{gsub(/\./,"/",$$2);gsub(/;/,"",$$2);print $$2;exit}' $$GENERATED_R_FILE`; \
-               mkdir -p $(TARGET_COMMON_OUT_ROOT)/R/$$dir; \
-               $(ACP) -fp $$GENERATED_R_FILE $(TARGET_COMMON_OUT_ROOT)/R/$$dir \
-                       || exit 31; \
-               $(ACP) -fp $$GENERATED_R_FILE $@ || exit 32; \
-       done;
-       @# Ensure that the target file is always created, i.e. also in case we did not
-       @# enter the GENERATED_R_FILE-loop above. This avoids unnecessary rebuilding.
-       $(hide) touch $@
+       $(call find-generated-R.java)
 
 $(proguard_options_file): $(R_file_stamp)
 
@@ -291,6 +356,8 @@ $(resource_export_package): $(all_res_assets) $(full_android_manifest) $(RenderS
        $(add-assets-to-package)
 endif
 
+endif  # USE_AAPT2
+
 # Other modules should depend on the BUILT module if
 # they want to use this module's R.java file.
 $(LOCAL_BUILT_MODULE): $(R_file_stamp)
@@ -325,7 +392,7 @@ else
 # Most packages should link against the resources defined by framework-res.
 # Even if they don't have their own resources, they may use framework
 # resources.
-ifneq ($(filter-out current system_current,$(LOCAL_SDK_RES_VERSION))$(if $(TARGET_BUILD_APPS),$(filter current system_current,$(LOCAL_SDK_RES_VERSION))),)
+ifneq ($(filter-out current system_current test_current,$(LOCAL_SDK_RES_VERSION))$(if $(TARGET_BUILD_APPS),$(filter current system_current test_current,$(LOCAL_SDK_RES_VERSION))),)
 # for released sdk versions, the platform resources were built into android.jar.
 framework_res_package_export := \
     $(HISTORICAL_SDK_VERSIONS_ROOT)/$(LOCAL_SDK_RES_VERSION)/android.jar
@@ -348,10 +415,13 @@ all_library_res_package_export_deps := \
     $(framework_res_package_export_deps) \
     $(foreach lib,$(LOCAL_RES_LIBRARIES),\
         $(call intermediates-dir-for,APPS,$(lib),,COMMON)/src/R.stamp)
-
 $(resource_export_package) $(R_file_stamp) $(LOCAL_BUILT_MODULE): $(all_library_res_package_export_deps)
 $(LOCAL_INTERMEDIATE_TARGETS): \
     PRIVATE_AAPT_INCLUDES := $(all_library_res_package_exports)
+
+ifdef USE_AAPT2
+$(my_res_package) : $(all_library_res_package_export_deps)
+endif
 endif # LOCAL_NO_STANDARD_LIBRARIES
 
 ifneq ($(full_classes_jar),)
@@ -400,7 +470,6 @@ $(LOCAL_BUILT_MODULE): PRIVATE_ADDITIONAL_CERTIFICATES := $(foreach c,\
     $(LOCAL_ADDITIONAL_CERTIFICATES), $(c).x509.pem $(c).pk8)
 
 # Define the rule to build the actual package.
-$(LOCAL_BUILT_MODULE): $(AAPT)
 # PRIVATE_JNI_SHARED_LIBRARIES is a list of <abi>:<path_of_built_lib>.
 $(LOCAL_BUILT_MODULE): PRIVATE_JNI_SHARED_LIBRARIES := $(jni_shared_libraries_with_abis)
 # PRIVATE_JNI_SHARED_LIBRARIES_ABI is a list of ABI names.
@@ -421,8 +490,24 @@ else
 endif
 endif
 $(LOCAL_BUILT_MODULE): PRIVATE_DONT_DELETE_JAR_DIRS := $(LOCAL_DONT_DELETE_JAR_DIRS)
-$(LOCAL_BUILT_MODULE): $(all_res_assets) $(jni_shared_libraries) $(full_android_manifest)
+$(LOCAL_BUILT_MODULE) : $(jni_shared_libraries)
+ifdef USE_AAPT2
+$(LOCAL_BUILT_MODULE): PRIVATE_RES_PACKAGE := $(my_res_package)
+$(LOCAL_BUILT_MODULE) : $(my_res_package) $(AAPT2) | $(ACP)
+else
+$(LOCAL_BUILT_MODULE) : $(all_res_assets) $(full_android_manifest) $(AAPT)
+endif
        @echo "target Package: $(PRIVATE_MODULE) ($@)"
+ifdef USE_AAPT2
+ifdef LOCAL_JACK_ENABLED
+       $(call copy-file-to-new-target)
+else
+       @# TODO: implement merge-two-packages.
+       $(if $(PRIVATE_SOURCE_ARCHIVE),\
+         $(call merge-two-packages,$(PRIVATE_RES_PACKAGE) $(PRIVATE_SOURCE_ARCHIVE),$@),
+         $(call copy-file-to-new-target))
+endif
+else  # USE_AAPT2
 ifdef LOCAL_JACK_ENABLED
        $(create-empty-package)
 else
@@ -431,6 +516,7 @@ else
          $(create-empty-package))
 endif
        $(add-assets-to-package)
+endif  # USE_AAPT2
 ifneq ($(jni_shared_libraries),)
        $(add-jni-shared-libs-to-package)
 endif
@@ -508,6 +594,18 @@ ALL_MODULES.$(my_register_name).BUILT_INSTALLED += \
 
 # Make sure to install the splits when you run "make <module_name>".
 $(my_register_name): $(installed_apk_splits)
+
+ifdef LOCAL_COMPATIBILITY_SUITE
+cts_testcase_file := $(foreach s,$(my_split_suffixes),$(COMPATIBILITY_TESTCASES_OUT_$(LOCAL_COMPATIBILITY_SUITE))/$(LOCAL_MODULE)_$(s).apk)
+$(cts_testcase_file) : $(COMPATIBILITY_TESTCASES_OUT_$(LOCAL_COMPATIBILITY_SUITE))/$(LOCAL_MODULE)_%.apk : $(built_module_path)/package_%.apk | $(ACP)
+       $(copy-file-to-new-target)
+
+COMPATIBILITY.$(LOCAL_COMPATIBILITY_SUITE).FILES := \
+  $(COMPATIBILITY.$(LOCAL_COMPATIBILITY_SUITE).FILES) \
+  $(cts_testcase_file)
+
+$(my_register_name) : $(cts_testcase_file)
+endif # LOCAL_COMPATIBILITY_SUITE
 endif # LOCAL_PACKAGE_SPLITS
 
 # Save information about this package
index 495f1a5..a10e671 100644 (file)
@@ -154,8 +154,8 @@ FRAMEWORKS_SUPPORT_JAVA_LIBRARIES := \
 #
 FRAMEWORKS_DATA_BINDING_SUBDIRS := \
         baseLibrary/src/main \
-        library/src/main \
-        library/src/doc
+        extensions/library/src/main \
+        extensions/library/src/doc
 
 #
 # A version of FRAMEWORKS_DATA_BINDING_SUBDIRS that is expanded to full paths from
index 95eb0cc..41c3590 100644 (file)
@@ -79,7 +79,9 @@ PDK_PLATFORM_JAVA_ZIP_JAVA_LIB_DIR := \
        $(PDK_PLATFORM_JAVA_ZIP_JAVA_HOST_LIB_DIR)
 
 PDK_PLATFORM_JAVA_ZIP_CONTENTS += $(foreach lib_dir,$(PDK_PLATFORM_JAVA_ZIP_JAVA_LIB_DIR),\
-    $(lib_dir)/classes.jack $(lib_dir)/classes.jar $(lib_dir)/javalib.jar)
+    $(lib_dir)/classes.jack $(lib_dir)/classes.jar $(lib_dir)/classes.jar.toc \
+    $(lib_dir)/javalib.jar  $(lib_dir)/classes*.dex \
+    $(lib_dir)/classes.dex.toc )
 
 # check and override java support level
 ifneq ($(TARGET_BUILD_PDK)$(PDK_FUSION_PLATFORM_ZIP),)
@@ -150,10 +152,8 @@ PDK_FUSION_OUT_DIR := $(DEBUG_OUT_DIR)
 endif
 
 define JAVA_dependency_template
-$(PDK_FUSION_OUT_DIR)/$(strip $(1)): $(_pdk_fusion_intermediates)/$(strip $(1)) \
-  $(PDK_FUSION_OUT_DIR)/$(strip $(2)) $(_pdk_fusion_stamp)
-       @mkdir -p $$(dir $$@)
-       $(hide) cp -fpPR $$< $$@
+$(call add-dependency,$(PDK_FUSION_OUT_DIR)/$(strip $(1)),\
+  $(foreach d,$(filter $(2),$(_pdk_fusion_java_file_list)),$(PDK_FUSION_OUT_DIR)/$(d)))
 endef
 
 # needs explicit dependency as package-export.apk is not explicitly pulled
@@ -166,6 +166,14 @@ $(foreach lib_dir,$(PDK_PLATFORM_JAVA_ZIP_JAVA_TARGET_LIB_DIR),\
 $(eval $(call JAVA_dependency_template,$(lib_dir)/javalib.jar,\
 $(lib_dir)/classes.jar)))
 
+# pull .jack and .dex files
+$(foreach lib_dir,$(PDK_PLATFORM_JAVA_ZIP_JAVA_TARGET_LIB_DIR),\
+  $(eval $(call JAVA_dependency_template,$(lib_dir)/classes.jar.toc,\
+    $(lib_dir)/classes.jar $(lib_dir)/classes.jack)))
+$(foreach lib_dir,$(PDK_PLATFORM_JAVA_ZIP_JAVA_TARGET_LIB_DIR),\
+  $(eval $(call JAVA_dependency_template,$(lib_dir)/classes.dex.toc,\
+    $(lib_dir)/classes.jar $(lib_dir)/classes.jack $(lib_dir)/classes%.dex)))
+
 # implicit rules for all other target files
 $(TARGET_COMMON_OUT_ROOT)/% : $(_pdk_fusion_intermediates)/target/common/% $(_pdk_fusion_stamp)
        @mkdir -p $(dir $@)
index 7598768..d44f090 100644 (file)
@@ -299,11 +299,12 @@ common_javalib_jar := $(intermediates.COMMON)/javalib.jar
 
 $(common_classes_jar) $(common_javalib_jar): PRIVATE_MODULE := $(LOCAL_MODULE)
 
-ifneq ($(filter %.aar, $(my_prebuilt_src_file)),)
+my_src_aar := $(filter %.aar, $(my_prebuilt_src_file))
+ifneq ($(my_src_aar),)
 # This is .aar file, archive of classes.jar and Android resources.
 my_src_jar := $(intermediates.COMMON)/aar/classes.jar
 
-$(my_src_jar) : $(my_prebuilt_src_file)
+$(my_src_jar) : $(my_src_aar)
        $(hide) rm -rf $(dir $@) && mkdir -p $(dir $@)
        $(hide) unzip -qo -d $(dir $@) $<
        # Make sure the extracted classes.jar has a new timestamp.
@@ -321,6 +322,26 @@ $(common_javalib_jar) : $(common_classes_jar) | $(ACP)
 
 $(call define-jar-to-toc-rule, $(common_classes_jar))
 
+ifdef USE_AAPT2
+my_library_resources := $(intermediates.COMMON)/library-res.flata
+ifneq ($(my_src_aar),)
+# Compile the AAR resources to a .flata.
+$(my_library_resources): PRIVATE_SOURCE_RES_DIR := $(intermediates.COMMON)/aar/res
+$(my_library_resources) : $(my_src_jar)
+       @echo "AAPT2 compile AAR $@ <- $(PRIVATE_SOURCE_RES_DIR)"
+       $(call aapt2-compile-one-resource-dir)
+else  # $(my_src_aar)
+# Create an empty packag for prebuilt static Java library.
+# TODO: support compiled resources inside a prebuilt static Java library.
+$(my_library_resources): PRIVATE_RES_DIR := $(intermediates.COMMON)/flat-res/res
+$(my_library_resources) :
+       @echo "Create empty library resources $@"
+       @rm -rf $@ && mkdir -p $(dir $@) $(PRIVATE_RES_DIR)
+       $(hide) cd $(dir $(PRIVATE_RES_DIR)) && zip -qrX $(abspath $@) $(notdir $(PRIVATE_RES_DIR))
+endif  # $(my_src_aar)
+# Make sure my_library_resources is created when you run mm/mmm.
+$(built_module) : $(my_library_resources)
+endif  # USE_AAPT2
 # make sure the classes.jar and javalib.jar are built before $(LOCAL_BUILT_MODULE)
 $(built_module) : $(common_javalib_jar)
 endif # TARGET JAVA_LIBRARIES
index 6aefa8d..151dac0 100644 (file)
@@ -149,7 +149,7 @@ endif
 unbundled_goals := $(strip $(filter APP-%,$(MAKECMDGOALS)))
 ifdef unbundled_goals
   ifneq ($(words $(unbundled_goals)),1)
-    $(error Only one APP-* goal may be specified; saw "$(unbundled_goals)"))
+    $(error Only one APP-* goal may be specified; saw "$(unbundled_goals)")
   endif
   TARGET_BUILD_APPS := $(strip $(subst -, ,$(patsubst APP-%,%,$(unbundled_goals))))
   ifneq ($(filter $(DEFAULT_GOAL),$(MAKECMDGOALS)),)
@@ -299,9 +299,14 @@ PRODUCT_AAPT_CONFIG := \
 
 # product-scoped aapt flags
 PRODUCT_AAPT_FLAGS :=
+PRODUCT_AAPT2_CFLAGS :=
 ifneq ($(filter en_XA ar_XB,$(PRODUCT_LOCALES)),)
-# Force generating resources for pseudo-locales.
-PRODUCT_AAPT_FLAGS += --pseudo-localize
+  # Force generating resources for pseudo-locales.
+  ifdef USE_AAPT2
+    PRODUCT_AAPT2_CFLAGS += --pseudo-localize
+  else
+    PRODUCT_AAPT_FLAGS += --pseudo-localize
+  endif
 endif
 
 PRODUCT_BRAND := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_BRAND))
index 0641627..6ed1f9b 100644 (file)
@@ -10,9 +10,9 @@
 #-flattenpackagehierarchy
 
 # Keep classes and methods that have the guava @VisibleForTesting annotation
--keep @com.google.common.annotations.VisibleForTesting class *
+-keep @**.VisibleForTesting class *
 -keepclassmembers class * {
-@com.google.common.annotations.VisibleForTesting *;
+@**.VisibleForTesting *;
 }
 
 -include proguard_basic_keeps.flags
index d956124..6efeb35 100644 (file)
@@ -27,6 +27,13 @@ LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 include $(BUILD_SYSTEM)/configure_local_jack.mk
 #################################
 
+intermediates.COMMON := $(call local-intermediates-dir,COMMON)
+
+my_res_package :=
+# A zip file that apps can link with aapt2
+# We need my_library_resources as dependency even if a library doesn't have resource.
+my_library_resources := $(intermediates.COMMON)/library-res.flata
+
 # Hack to build static Java library with Android resource
 # See bug 5714516
 all_resources :=
@@ -34,6 +41,7 @@ need_compile_res :=
 # A static Java library needs to explicily set LOCAL_RESOURCE_DIR.
 ifdef LOCAL_RESOURCE_DIR
 need_compile_res := true
+
 all_resources := $(strip \
     $(foreach dir, $(LOCAL_RESOURCE_DIR), \
       $(addprefix $(dir)/, \
@@ -56,7 +64,6 @@ endif
 
 proguard_options_file :=
 
-intermediates.COMMON := $(call local-intermediates-dir,COMMON)
 ifneq ($(LOCAL_PROGUARD_ENABLED),custom)
   proguard_options_file := $(intermediates.COMMON)/proguard_options
 endif
@@ -70,6 +77,18 @@ endif
 LOCAL_JACK_PROGUARD_FLAGS := $(addprefix -include ,$(proguard_options_file)) $(LOCAL_JACK_PROGUARD_FLAGS)
 endif # LOCAL_JACK_ENABLED
 
+R_file_stamp := $(intermediates.COMMON)/src/R.stamp
+LOCAL_INTERMEDIATE_TARGETS += $(R_file_stamp)
+
+ifdef USE_AAPT2
+# For library we treat all the resource equal with no overlay.
+my_res_resources := $(all_resources)
+my_overlay_resources :=
+# For libraries put everything in the COMMON intermediate directory.
+my_res_package := $(intermediates.COMMON)/package-res.apk
+
+LOCAL_INTERMEDIATE_TARGETS += $(my_res_package)
+endif  # USE_AAPT2
 endif  # LOCAL_RESOURCE_DIR
 
 all_res_assets := $(all_resources)
@@ -77,8 +96,6 @@ all_res_assets := $(all_resources)
 include $(BUILD_SYSTEM)/java_library.mk
 
 ifeq (true,$(need_compile_res))
-R_file_stamp := $(LOCAL_INTERMEDIATE_SOURCE_DIR)/R.stamp
-
 include $(BUILD_SYSTEM)/android_manifest.mk
 
 LOCAL_SDK_RES_VERSION:=$(strip $(LOCAL_SDK_RES_VERSION))
@@ -90,7 +107,7 @@ framework_res_package_export :=
 framework_res_package_export_deps :=
 # Please refer to package.mk
 ifneq ($(LOCAL_NO_STANDARD_LIBRARIES),true)
-ifneq ($(filter-out current system_current,$(LOCAL_SDK_RES_VERSION))$(if $(TARGET_BUILD_APPS),$(filter current system_current,$(LOCAL_SDK_RES_VERSION))),)
+ifneq ($(filter-out current system_current test_current,$(LOCAL_SDK_RES_VERSION))$(if $(TARGET_BUILD_APPS),$(filter current system_current test_current,$(LOCAL_SDK_RES_VERSION))),)
 framework_res_package_export := \
     $(HISTORICAL_SDK_VERSIONS_ROOT)/$(LOCAL_SDK_RES_VERSION)/android.jar
 framework_res_package_export_deps := $(framework_res_package_export)
@@ -102,29 +119,41 @@ framework_res_package_export_deps := \
 endif
 endif
 
-$(R_file_stamp): PRIVATE_MODULE := $(LOCAL_MODULE)
 # add --non-constant-id to prevent inlining constants.
 # AAR needs text symbol file R.txt.
-$(R_file_stamp): PRIVATE_AAPT_FLAGS := $(LOCAL_AAPT_FLAGS) --non-constant-id --output-text-symbols $(LOCAL_INTERMEDIATE_SOURCE_DIR)
-$(R_file_stamp): PRIVATE_SOURCE_INTERMEDIATES_DIR := $(LOCAL_INTERMEDIATE_SOURCE_DIR)
-$(R_file_stamp): PRIVATE_ANDROID_MANIFEST := $(full_android_manifest)
-$(R_file_stamp): PRIVATE_RESOURCE_PUBLICS_OUTPUT := $(intermediates.COMMON)/public_resources.xml
-$(R_file_stamp): PRIVATE_RESOURCE_DIR := $(LOCAL_RESOURCE_DIR)
-$(R_file_stamp): PRIVATE_AAPT_INCLUDES := $(framework_res_package_export)
-ifneq (,$(filter-out current system_current, $(LOCAL_SDK_VERSION)))
-$(R_file_stamp): PRIVATE_DEFAULT_APP_TARGET_SDK := $(LOCAL_SDK_VERSION)
+ifdef USE_AAPT2
+$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_AAPT_FLAGS := $(LOCAL_AAPT_FLAGS) --non-final-ids
 else
-$(R_file_stamp): PRIVATE_DEFAULT_APP_TARGET_SDK := $(DEFAULT_APP_TARGET_SDK)
+$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_AAPT_FLAGS := $(LOCAL_AAPT_FLAGS) --non-constant-id --output-text-symbols $(LOCAL_INTERMEDIATE_SOURCE_DIR)
 endif
-$(R_file_stamp): PRIVATE_ASSET_DIR :=
-$(R_file_stamp): PRIVATE_PROGUARD_OPTIONS_FILE := $(proguard_options_file)
-$(R_file_stamp): PRIVATE_MANIFEST_PACKAGE_NAME :=
-$(R_file_stamp): PRIVATE_MANIFEST_INSTRUMENTATION_FOR :=
-
+$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_SOURCE_INTERMEDIATES_DIR := $(LOCAL_INTERMEDIATE_SOURCE_DIR)
+$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_ANDROID_MANIFEST := $(full_android_manifest)
+$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_RESOURCE_PUBLICS_OUTPUT := $(intermediates.COMMON)/public_resources.xml
+$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_RESOURCE_DIR := $(LOCAL_RESOURCE_DIR)
+$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_AAPT_INCLUDES := $(framework_res_package_export)
+ifneq (,$(filter-out current system_current test_current, $(LOCAL_SDK_VERSION)))
+$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_DEFAULT_APP_TARGET_SDK := $(LOCAL_SDK_VERSION)
+else
+$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_DEFAULT_APP_TARGET_SDK := $(DEFAULT_APP_TARGET_SDK)
+endif
+$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_ASSET_DIR :=
+$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_PROGUARD_OPTIONS_FILE := $(proguard_options_file)
+$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_MANIFEST_PACKAGE_NAME :=
+$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_MANIFEST_INSTRUMENTATION_FOR :=
+
+ifdef USE_AAPT2
+# For libraries don't use any product specific flags.
+my_aapt_characteristics :=
+# One more level with name res so we can zip up the flat resources that can be linked by apps.
+my_compiled_res_base_dir := $(intermediates.COMMON)/flat-res/res
+include $(BUILD_SYSTEM)/aapt2.mk
+$(my_res_package) : $(framework_res_package_export_deps)
+else
 $(R_file_stamp) : $(all_resources) $(full_android_manifest) $(AAPT) $(framework_res_package_export_deps)
        @echo "target R.java/Manifest.java: $(PRIVATE_MODULE) ($@)"
        $(create-resource-java-files)
        $(hide) find $(PRIVATE_SOURCE_INTERMEDIATES_DIR) -name R.java | xargs cat > $@
+endif  # USE_AAPT2
 
 $(LOCAL_BUILT_MODULE): $(R_file_stamp)
 ifdef LOCAL_JACK_ENABLED
@@ -153,9 +182,20 @@ $(built_aar) : $(LOCAL_BUILT_MODULE)
 
 # Register the aar file.
 ALL_MODULES.$(LOCAL_MODULE).AAR := $(built_aar)
-
 endif  # need_compile_res
 
+ifdef USE_AAPT2
+# If a static Java library has no resources, create empty package apps can depend on.
+$(my_library_resources): PRIVATE_RES_DIR := $(intermediates.COMMON)/flat-res/res
+$(my_library_resources) : $(my_res_package)
+       @echo "Package static library resources $@"
+       @rm -rf $@ && mkdir -p $(dir $@) $(PRIVATE_RES_DIR)
+       $(hide) cd $(dir $(PRIVATE_RES_DIR)) && zip -qrX $(abspath $@) $(notdir $(PRIVATE_RES_DIR))
+
+# Make sure my_library_resources is created when you run mm/mmm.
+$(LOCAL_BUILT_MODULE) : $(my_library_resources)
+endif  # USE_AAPT2
+
 # Reset internal variables.
 all_res_assets :=
 LOCAL_IS_STATIC_JAVA_LIBRARY :=
index 683a075..3975d20 100644 (file)
@@ -129,4 +129,37 @@ update-system-api: $(INTERNAL_PLATFORM_SYSTEM_API_FILE) | $(ACP)
        @echo Copying system-removed.txt
        $(hide) $(ACP) $(INTERNAL_PLATFORM_SYSTEM_REMOVED_API_FILE) frameworks/base/api/system-removed.txt
 
+#####################Check Test API#####################
+.PHONY: check-test-api
+checkapi : check-test-api
+
+# Check that the Test API we're building hasn't changed from the not-yet-released
+# SDK version. Note that we don't check that we haven't broken the previous
+# SDK's API because the test API is meant only for CTS which is always
+# associated with the current release.
+$(eval $(call check-api, \
+    checktestapi-current, \
+    frameworks/base/api/test-current.txt, \
+    $(INTERNAL_PLATFORM_TEST_API_FILE), \
+    frameworks/base/api/test-removed.txt, \
+    $(INTERNAL_PLATFORM_TEST_REMOVED_API_FILE), \
+    -error 2 -error 3 -error 4 -error 5 -error 6 \
+    -error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \
+    -error 16 -error 17 -error 18 -error 19 -error 20 -error 21 -error 23 -error 24 \
+    -error 25 -error 26 -error 27, \
+    cat $(BUILD_SYSTEM)/apicheck_msg_current.txt, \
+    check-test-api, \
+    $(call doc-timestamp-for,test-api-stubs) \
+    ))
+
+.PHONY: update-test-api
+update-api : update-test-api
+
+update-test-api: $(INTERNAL_PLATFORM_TEST_API_FILE) | $(ACP)
+       @echo Copying test-current.txt
+       $(hide) $(ACP) $(INTERNAL_PLATFORM_TEST_API_FILE) frameworks/base/api/test-current.txt
+       @echo Copying test-removed.txt
+       $(hide) $(ACP) $(INTERNAL_PLATFORM_TEST_REMOVED_API_FILE) frameworks/base/api/test-removed.txt
+
+
 endif
diff --git a/core/tasks/cts_v2.mk b/core/tasks/cts_v2.mk
new file mode 100644 (file)
index 0000000..6bb80a1
--- /dev/null
@@ -0,0 +1,24 @@
+# Copyright (C) 2015 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT 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_suite_name := cts_v2
+test_suite_tradefed := cts-tradefed_v2
+test_suite_dynamic_config := cts/tools/cts-tradefed/DynamicConfig.xml
+test_suite_readme := cts/tools/cts-tradefed/README
+
+include $(BUILD_SYSTEM)/tasks/tools/compatibility.mk
+
+.PHONY: cts_v2
+cts_v2: $(compatibility_zip)
+$(call dist-for-goals, cts_v2, $(compatibility_zip))
diff --git a/core/tasks/tools/compatibility.mk b/core/tasks/tools/compatibility.mk
new file mode 100644 (file)
index 0000000..d8f900e
--- /dev/null
@@ -0,0 +1,52 @@
+# Copyright (C) 2015 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Package up a compatibility test suite in a zip file.
+#
+# Input variables:
+#   test_suite_name: the name of this test suite eg. cts
+#   test_suite_tradefed: the name of this test suite's tradefed wrapper
+#   test_suite_dynamic_config: the path to this test suite's dynamic configuration file
+#   test_suite_readme: the path to a README file for this test suite
+# Output variables:
+#   compatibility_zip: the path to the output zip file.
+
+out_dir := $(HOST_OUT)/$(test_suite_name)/android-$(test_suite_name)
+test_artifacts := $(COMPATIBILITY.$(test_suite_name).FILES)
+test_tools := $(HOST_OUT_JAVA_LIBRARIES)/hosttestlib.jar \
+  $(HOST_OUT_JAVA_LIBRARIES)/tradefed-prebuilt.jar \
+  $(HOST_OUT_JAVA_LIBRARIES)/compatibility-host-util.jar \
+  $(HOST_OUT_JAVA_LIBRARIES)/$(test_suite_tradefed).jar \
+  $(HOST_OUT_EXECUTABLES)/$(test_suite_tradefed) \
+  $(test_suite_readme)
+
+compatibility_zip := $(out_dir).zip
+$(compatibility_zip): PRIVATE_NAME := android-$(test_suite_name)
+$(compatibility_zip): PRIVATE_OUT_DIR := $(out_dir)
+$(compatibility_zip): PRIVATE_TOOLS := $(test_tools)
+$(compatibility_zip): PRIVATE_SUITE_NAME := $(test_suite_name)
+$(compatibility_zip): PRIVATE_DYNAMIC_CONFIG := $(test_suite_dynamic_config)
+$(compatibility_zip): $(test_artifacts) $(test_tools) $(test_suite_dynamic_config) | $(ADB) $(ACP)
+# Make dir structure
+       $(hide) mkdir -p $(PRIVATE_OUT_DIR)/tools $(PRIVATE_OUT_DIR)/testcases
+# Copy tools
+       $(hide) $(ACP) -fp $(PRIVATE_TOOLS) $(PRIVATE_OUT_DIR)/tools
+       $(if $(PRIVATE_DYNAMIC_CONFIG),$(hide) $(ACP) -fp $(PRIVATE_DYNAMIC_CONFIG) $(PRIVATE_OUT_DIR)/testcases/$(PRIVATE_SUITE_NAME).dynamic)
+       $(hide) cd $(dir $@) && zip -rq $(notdir $@) $(PRIVATE_NAME)
+
+# Reset all input variables
+test_suite_name :=
+test_suite_tradefed :=
+test_suite_dynamic_config :=
+test_suite_readme :=
index af5f516..5a31846 100644 (file)
@@ -43,7 +43,7 @@ ifeq "" "$(PLATFORM_VERSION)"
   # which is the version that we reveal to the end user.
   # Update this value when the platform version changes (rather
   # than overriding it somewhere else).  Can be an arbitrary string.
-  PLATFORM_VERSION := 6.0.1
+  PLATFORM_VERSION := N
 endif
 
 ifeq "" "$(PLATFORM_SDK_VERSION)"
@@ -61,7 +61,7 @@ endif
 ifeq "" "$(PLATFORM_VERSION_CODENAME)"
   # This is the current development code-name, if the build is not a final
   # release build.  If this is a final release build, it is simply "REL".
-  PLATFORM_VERSION_CODENAME := REL
+  PLATFORM_VERSION_CODENAME := N
 
   # This is all of the development codenames that are active.  Should be either
   # the same as PLATFORM_VERSION_CODENAME or a comma-separated list of additional
@@ -82,7 +82,7 @@ else
     # assuming the device can only support APIs as of the previous official
     # public release.
     # This value will always be 0 for release builds.
-    PLATFORM_PREVIEW_SDK_VERSION := 0
+    PLATFORM_PREVIEW_SDK_VERSION := 1
   endif
 endif
 
index b1cefca..aea7a37 100644 (file)
@@ -77,9 +77,4 @@ TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true
 
 BOARD_SEPOLICY_DIRS += build/target/board/generic/sepolicy
 
-ifeq ($(TARGET_PRODUCT),sdk)
-  # include an expanded selection of fonts for the SDK.
-  EXTENDED_FONT_FOOTPRINT := true
-endif
-
 USE_CLANG_PLATFORM_BUILD := true
index 50924f8..910107a 100644 (file)
@@ -53,7 +53,7 @@ BUILD_EMULATOR_OPENGL := true
 USE_OPENGL_RENDERER := true
 
 TARGET_USERIMAGES_USE_EXT4 := true
-BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1342177280
+BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1610612736
 BOARD_USERDATAIMAGE_PARTITION_SIZE := 734003200
 BOARD_CACHEIMAGE_PARTITION_SIZE := 69206016
 BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4
index d5430cd..97fd525 100644 (file)
@@ -65,7 +65,7 @@ BUILD_EMULATOR_OPENGL := true
 USE_OPENGL_RENDERER := true
 
 TARGET_USERIMAGES_USE_EXT4 := true
-BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1342177280  # 1.25 GB swag, 20% more than before
+BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1610612736
 BOARD_USERDATAIMAGE_PARTITION_SIZE := 1610612736  # 1.5 GB, lots of space for running tests
 BOARD_CACHEIMAGE_PARTITION_SIZE := 69206016
 BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4
index 44772eb..8506724 100644 (file)
@@ -32,7 +32,7 @@ BUILD_EMULATOR_OPENGL := true
 USE_OPENGL_RENDERER := true
 
 TARGET_USERIMAGES_USE_EXT4 := true
-BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1342177280  # 1.25 GB
+BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1610612736
 BOARD_USERDATAIMAGE_PARTITION_SIZE := 576716800
 BOARD_CACHEIMAGE_PARTITION_SIZE := 69206016
 BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4
index cbfda6b..fd06e70 100755 (executable)
@@ -38,7 +38,7 @@ BUILD_EMULATOR_OPENGL := true
 USE_OPENGL_RENDERER := true
 
 TARGET_USERIMAGES_USE_EXT4 := true
-BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1342177280  # 1.25 GB
+BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1610612736
 BOARD_USERDATAIMAGE_PARTITION_SIZE := 576716800
 BOARD_CACHEIMAGE_PARTITION_SIZE := 69206016
 BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4
index 4c49e86..880c1a2 100644 (file)
@@ -26,9 +26,11 @@ PRODUCT_PACKAGES += \
     android.test.runner \
     app_process \
     applypatch \
+    audioserver \
     blkid \
     bmgr \
     bugreport \
+    cameraserver \
     content \
     dhcpcd \
     dhcpcd-run-hooks \
@@ -39,6 +41,9 @@ PRODUCT_PACKAGES += \
     hid \
     ime \
     input \
+    input.evdev.default \
+    inputflinger \
+    inputflingerhost \
     javax.obex \
     libandroid \
     libandroid_runtime \
@@ -50,12 +55,14 @@ PRODUCT_PACKAGES += \
     libbundlewrapper \
     libcamera_client \
     libcameraservice \
+    libcamera2ndk \
     libdl \
     libdrmclearkeyplugin \
     libeffectproxy \
     libeffects \
     libinput \
     libinputflinger \
+    libinputflingerhost \
     libiprouteutil \
     libjnigraphics \
     libldnhncr \
@@ -94,10 +101,12 @@ PRODUCT_PACKAGES += \
     libvisualizer \
     libvorbisidec \
     libmediandk \
+    libvulkan \
     libwifi-service \
     media \
     media_cmd \
     mediaserver \
+    mediaextractor \
     monkey \
     mtpd \
     ndc \
index 065474d..b9fcdc8 100644 (file)
@@ -22,6 +22,7 @@
 
 PRODUCT_PACKAGES += \
     BasicDreams \
+    BlockedNumberProvider \
     BookmarkProvider \
     Browser2 \
     Calendar \
@@ -42,6 +43,7 @@ PRODUCT_PACKAGES += \
     LatinIME \
     Launcher2 \
     ManagedProvisioning \
+    MtpDocumentsProvider \
     PicoTts \
     PacProcessor \
     libpac \
index 71456dc..55de3b9 100644 (file)
@@ -23,6 +23,7 @@ PRODUCT_PACKAGES += \
     atrace \
     bootanimation \
     bootstat \
+    cmd \
     debuggerd \
     dumpstate \
     dumpsys \
index acc7a98..146e0a8 100644 (file)
@@ -59,3 +59,5 @@ PRODUCT_COPY_FILES += \
     device/generic/goldfish/init.ranchu.rc:root/init.ranchu.rc \
     device/generic/goldfish/fstab.ranchu:root/fstab.ranchu \
     device/generic/goldfish/ueventd.ranchu.rc:root/ueventd.ranchu.rc
+
+PRODUCT_CHARACTERISTICS := emulator
index 94efe52..71a6547 100644 (file)
@@ -55,3 +55,5 @@ PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \
     dalvik.vm.dex2oat-Xms=64m \
     dalvik.vm.dex2oat-Xmx=512m \
     ro.dalvik.vm.native.bridge=0 \
+    dalvik.vm.usejit=true \
+    dalvik.vm.usejitprofiles=true
index 73c2524..12a8da5 100644 (file)
@@ -63,6 +63,7 @@ PRODUCT_COPY_FILES := \
        device/generic/goldfish/data/etc/apns-conf.xml:system/etc/apns-conf.xml \
        frameworks/base/data/sounds/effects/camera_click.ogg:system/media/audio/ui/camera_click.ogg \
        frameworks/base/data/sounds/effects/VideoRecord.ogg:system/media/audio/ui/VideoRecord.ogg \
+       frameworks/base/data/sounds/effects/VideoStop.ogg:system/media/audio/ui/VideoStop.ogg \
        device/generic/goldfish/data/etc/handheld_core_hardware.xml:system/etc/permissions/handheld_core_hardware.xml \
        device/generic/goldfish/camera/media_profiles.xml:system/etc/media_profiles.xml \
        frameworks/av/media/libstagefright/data/media_codecs_google_audio.xml:system/etc/media_codecs_google_audio.xml \
index 919d024..e840ba1 100644 (file)
@@ -21,6 +21,8 @@ PRODUCT_PACKAGES := \
     CarrierConfig \
     Dialer \
     CallLogBackup \
+    CellBroadcastReceiver \
+    EmergencyInfo \
     rild
 
 PRODUCT_COPY_FILES := \
index 838ddbe..9db0466 100644 (file)
@@ -80,7 +80,7 @@
         <?cs call:header_search_widget() ?>
         <?cs /if ?>
 
-        <?cs if:ndk ?><a class="dac-header-console-btn" href="http://developer.android.com">
+        <?cs if:ndk ?><a class="dac-header-console-btn" href="//developer.android.com">
           <span class="dac-visible-desktop-inline">Back to Android Developers</span>
         </a><?cs else ?><a class="dac-header-console-btn" href="https://play.google.com/apps/publish/">
           <span class="dac-sprite dac-google-play"></span>
     <div style="height:20px"><!-- spacer to bump header down --></div>
     <div id="butterbar-wrapper">
       <div id="butterbar">
-        <a href="http://googleblog.blogspot.com/" id="butterbar-message">
+        <a href="//googleblog.blogspot.com/" id="butterbar-message">
           The Android 5.0 SDK will be available on October 17th!
         </a>
       </div>
index aaef8ed..d52f0e4 100644 (file)
@@ -585,7 +585,7 @@ def:custom_left_nav() ?><?cs
 <?cs # appears at the bottom of every page ?><?cs
 def:custom_cc_copyright() ?>
   Except as noted, this content is
-  licensed under <a href="http://creativecommons.org/licenses/by/2.5/">
+  licensed under <a href="//creativecommons.org/licenses/by/2.5/">
   Creative Commons Attribution 2.5</a>. For details and
   restrictions, see the <a href="<?cs var:toroot ?>license.html">Content
   License</a>.<?cs
@@ -594,7 +594,7 @@ def:custom_cc_copyright() ?>
 <?cs
 def:custom_copyright() ?>
   Except as noted, this content is licensed under <a
-  href="http://www.apache.org/licenses/LICENSE-2.0">Apache 2.0</a>.
+  href="//www.apache.org/licenses/LICENSE-2.0">Apache 2.0</a>.
   For details and restrictions, see the <a href="<?cs var:toroot ?>license.html">
   Content License</a>.<?cs
 /def ?>
index b945a1c..4a523ce 100644 (file)
@@ -7,7 +7,7 @@
       Android Design<?cs if:page.title ?> - <?cs var:page.title ?><?cs /if ?>
     </title>
     <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
-    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
+    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic">
     <link rel="stylesheet" href="<?cs var:toroot ?>assets/yui-3.3.0-reset-min.css">
     <link rel="stylesheet" href="<?cs var:toroot ?>assets/design/default.css">
     <script src="<?cs var:toroot ?>assets/jquery-1.6.2.min.js"></script>
 
         <p id="copyright">
           Except as noted, this content is licensed under
-          <a href="http://creativecommons.org/licenses/by/2.5/">
+          <a href="//creativecommons.org/licenses/by/2.5/">
           Creative Commons Attribution 2.5</a>.<br>
           For details and restrictions, see the
-          <a href="http://developer.android.com/license.html">Content License</a>.
+          <a href="//developer.android.com/license.html">Content License</a>.
         </p>
 
         <p>
-          <a href="http://www.android.com/terms.html">Site Terms of Service</a> &ndash;
-          <a href="http://www.android.com/privacy.html">Privacy Policy</a> &ndash;
-          <a href="http://www.android.com/branding.html">Brand Guidelines</a>
+          <a href="//www.android.com/terms.html">Site Terms of Service</a> &ndash;
+          <a href="//www.android.com/privacy.html">Privacy Policy</a> &ndash;
+          <a href="//www.android.com/branding.html">Brand Guidelines</a>
         </p>
 
       </div>
index 1ffee63..a0900f2 100644 (file)
@@ -7,7 +7,7 @@
       </div>
       <div class="col-1of2 dac-footer-reachout">
         <div class="dac-footer-contact">
-          <a class="dac-footer-contact-link" href="http://android-developers.blogspot.com/">Blog</a>
+          <a class="dac-footer-contact-link" href="//android-developers.blogspot.com/">Blog</a>
           <a class="dac-footer-contact-link" href="/support.html">Support</a>
         </div>
         <div class="dac-footer-social">
index babb3c7..c668203 100644 (file)
 <!-- STYLESHEETS -->
 <link rel="stylesheet"
 href="<?cs
-if:android.whichdoc != 'online' ?>http:<?cs
+if:android.whichdoc != 'online' ?>https:<?cs
 /if ?>//fonts.googleapis.com/css?family=Roboto+Condensed">
 <link rel="stylesheet" href="<?cs
-if:android.whichdoc != 'online' ?>http:<?cs
+if:android.whichdoc != 'online' ?>https:<?cs
 /if ?>//fonts.googleapis.com/css?family=Roboto:light,regular,medium,thin,italic,mediumitalic,bold"
   title="roboto">
 <?cs 
   if:ndk ?><link rel="stylesheet" href="<?cs
-  if:android.whichdoc != 'online' ?>http:<?cs
+  if:android.whichdoc != 'online' ?>https:<?cs
   /if ?>//fonts.googleapis.com/css?family=Roboto+Mono:400,500,700" title="roboto-mono" type="text/css"><?cs
 /if ?>
 <link href="<?cs var:toroot ?>assets/css/default.css?v=7" rel="stylesheet" type="text/css">
@@ -50,7 +50,7 @@ type="text/css">
 <?cs /if ?>
 
 <!-- JAVASCRIPT -->
-<script src="<?cs if:android.whichdoc != 'online' ?>http:<?cs /if ?>//www.google.com/jsapi" type="text/javascript"></script>
+<script src="<?cs if:android.whichdoc != 'online' ?>https:<?cs /if ?>//www.google.com/jsapi" type="text/javascript"></script>
 <?cs
 if:devsite
   ?><script src="<?cs var:toroot ?>_static/js/android_3p-bundle.js" type="text/javascript"></script><?cs
index 47c2992..401f183 100644 (file)
@@ -86,7 +86,7 @@
     <td>Windows 32-bit</td>
     <td>
   <a onClick="return onDownload(this)"
-     href="http://dl.google.com/android/ndk/<?cs var:ndk.win32_download ?>"><?cs var:ndk.win32_download ?></a>
+     href="//dl.google.com/android/ndk/<?cs var:ndk.win32_download ?>"><?cs var:ndk.win32_download ?></a>
     </td>
     <td><?cs var:ndk.win32_bytes ?></td>
     <td><?cs var:ndk.win32_checksum ?></td>
@@ -94,7 +94,7 @@
  <!-- <tr>
    <td>
   <a onClick="return onDownload(this)"
-     href="http://dl.google.com/android/ndk/<?cs var:ndk.win32.legacy_download ?>"><?cs var:ndk.win32.legacy_download ?></a>
+     href="//dl.google.com/android/ndk/<?cs var:ndk.win32.legacy_download ?>"><?cs var:ndk.win32.legacy_download ?></a>
     </td>
     <td><?cs var:ndk.win32.legacy_bytes ?></td>
     <td><?cs var:ndk.win32.legacy_checksum ?></td>
     <td>Windows 64-bit</td>
     <td>
   <a onClick="return onDownload(this)"
-     href="http://dl.google.com/android/ndk/<?cs var:ndk.win64_download ?>"><?cs var:ndk.win64_download ?></a>
+     href="//dl.google.com/android/ndk/<?cs var:ndk.win64_download ?>"><?cs var:ndk.win64_download ?></a>
     </td>
     <td><?cs var:ndk.win64_bytes ?></td>
     <td><?cs var:ndk.win64_checksum ?></td>
  <!--  <tr>
     <td>
   <a onClick="return onDownload(this)"
-     href="http://dl.google.com/android/ndk/<?cs var:ndk.win64.legacy_download ?>"><?cs var:ndk.win64.legacy_download ?></a>
+     href="//dl.google.com/android/ndk/<?cs var:ndk.win64.legacy_download ?>"><?cs var:ndk.win64.legacy_download ?></a>
     </td>
     <td><?cs var:ndk.win64.legacy_bytes ?></td>
     <td><?cs var:ndk.win64.legacy_checksum ?></td>
     <td>Mac OS X 32-bit</td>
     <td>
   <a onClick="return onDownload(this)"
-     href="http://dl.google.com/android/ndk/<?cs var:ndk.mac32_download ?>"><?cs var:ndk.mac32_download ?></a>
+     href="//dl.google.com/android/ndk/<?cs var:ndk.mac32_download ?>"><?cs var:ndk.mac32_download ?></a>
     </td>
     <td><?cs var:ndk.mac32_bytes ?></td>
     <td><?cs var:ndk.mac32_checksum ?></td>
   <tr>
     <td>
   <a onClick="return onDownload(this)"
-     href="http://dl.google.com/android/ndk/<?cs var:ndk.mac32.legacy_download ?>"><?cs var:ndk.mac32.legacy_download ?></a>
+     href="//dl.google.com/android/ndk/<?cs var:ndk.mac32.legacy_download ?>"><?cs var:ndk.mac32.legacy_download ?></a>
     </td>
     <td><?cs var:ndk.mac32.legacy_bytes ?></td>
     <td><?cs var:ndk.mac32.legacy_checksum ?></td>
     <td>Mac OS X 64-bit</td>
     <td>
   <a onClick="return onDownload(this)"
-     href="http://dl.google.com/android/ndk/<?cs var:ndk.mac64_download ?>"><?cs var:ndk.mac64_download ?></a>
+     href="//dl.google.com/android/ndk/<?cs var:ndk.mac64_download ?>"><?cs var:ndk.mac64_download ?></a>
     </td>
     <td><?cs var:ndk.mac64_bytes ?></td>
     <td><?cs var:ndk.mac64_checksum ?></td>
  <!--  <tr>
     <td>
   <a onClick="return onDownload(this)"
-     href="http://dl.google.com/android/ndk/<?cs var:ndk.mac64.legacy_download ?>"><?cs var:ndk.mac64.legacy_download ?></a>
+     href="//dl.google.com/android/ndk/<?cs var:ndk.mac64.legacy_download ?>"><?cs var:ndk.mac64.legacy_download ?></a>
     </td>
     <td><?cs var:ndk.mac64.legacy_bytes ?></td>
     <td><?cs var:ndk.mac64.legacy_checksum ?></td>
     <td>Linux 32-bit (x86)</td>
     <td>
   <a onClick="return onDownload(this)"
-     href="http://dl.google.com/android/ndk/<?cs var:ndk.linux32_download ?>"><?cs var:ndk.linux32_download ?></a>
+     href="//dl.google.com/android/ndk/<?cs var:ndk.linux32_download ?>"><?cs var:ndk.linux32_download ?></a>
     </td>
     <td><?cs var:ndk.linux32_bytes ?></td>
     <td><?cs var:ndk.linux32_checksum ?></td>
  <!--  <tr>
     <td>
   <a onClick="return onDownload(this)"
-     href="http://dl.google.com/android/ndk/<?cs var:ndk.linux32.legacy_download ?>"><?cs var:ndk.linux32.legacy_download ?></a>
+     href="//dl.google.com/android/ndk/<?cs var:ndk.linux32.legacy_download ?>"><?cs var:ndk.linux32.legacy_download ?></a>
     </td>
     <td><?cs var:ndk.linux32.legacy_bytes ?></td>
     <td><?cs var:ndk.linux32.legacy_checksum ?></td>
     <td>Linux 64-bit (x86)</td>
     <td>
   <a onClick="return onDownload(this)"
-     href="http://dl.google.com/android/ndk/<?cs var:ndk.linux64_download ?>"><?cs var:ndk.linux64_download ?></a>
+     href="//dl.google.com/android/ndk/<?cs var:ndk.linux64_download ?>"><?cs var:ndk.linux64_download ?></a>
     </td>
     <td><?cs var:ndk.linux64_bytes ?></td>
     <td><?cs var:ndk.linux64_checksum ?></td>
   <!--  <tr>
     <td>
   <a onClick="return onDownload(this)"
-     href="http://dl.google.com/android/ndk/<?cs var:ndk.linux64.legacy_download ?>"><?cs var:ndk.linux64.legacy_download ?></a>
+     href="//dl.google.com/android/ndk/<?cs var:ndk.linux64.legacy_download ?>"><?cs var:ndk.linux64.legacy_download ?></a>
     </td>
     <td><?cs var:ndk.linux64.legacy_bytes ?></td>
     <td><?cs var:ndk.linux64.legacy_checksum ?></td>
@@ -286,7 +286,7 @@ Also see the <a href="<?cs var:toroot ?>tools/sdk/tools-notes.html">SDK tools re
   <tr>
     <td rowspan="2">Windows</td>
     <td>
-  <a onclick="return onDownload(this)" id="win-tools" href="http://dl.google.com/android/<?cs
+  <a onclick="return onDownload(this)" id="win-tools" href="//dl.google.com/android/<?cs
 var:sdk.win_installer
 ?>"><?cs var:sdk.win_installer ?></a> (Recommended)
     </td>
@@ -296,7 +296,7 @@ var:sdk.win_installer
   <tr>
     <!-- blank TD from Windows rowspan -->
     <td>
-  <a onclick="return onDownload(this)" href="http://dl.google.com/android/<?cs var:sdk.win_download
+  <a onclick="return onDownload(this)" href="//dl.google.com/android/<?cs var:sdk.win_download
 ?>"><?cs var:sdk.win_download ?></a>
     </td>
     <td><?cs var:sdk.win_bytes ?> bytes</td>
@@ -305,7 +305,7 @@ var:sdk.win_installer
   <tr>
     <td><nobr>Mac OS X</nobr></td>
     <td>
-  <a onclick="return onDownload(this)" id="mac-tools" href="http://dl.google.com/android/<?cs
+  <a onclick="return onDownload(this)" id="mac-tools" href="//dl.google.com/android/<?cs
 var:sdk.mac_download
 ?>"><?cs var:sdk.mac_download ?></a>
     </td>
@@ -315,7 +315,7 @@ var:sdk.mac_download
   <tr>
     <td>Linux</td>
     <td>
-  <a onclick="return onDownload(this)" id="linux-tools" href="http://dl.google.com/android/<?cs
+  <a onclick="return onDownload(this)" id="linux-tools" href="//dl.google.com/android/<?cs
 var:sdk.linux_download
 ?>"><?cs var:sdk.linux_download ?></a>
     </td>