summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/Makefile49
-rw-r--r--core/android_manifest.mk22
-rw-r--r--core/apicheck_msg_current.txt2
-rw-r--r--core/binary.mk19
-rw-r--r--core/cleanbuild.mk15
-rw-r--r--core/clear_vars.mk3
-rw-r--r--core/combo/HOST_windows-x86.mk2
-rw-r--r--core/dpi_specific_apk.mk70
-rw-r--r--core/dynamic_binary.mk12
-rw-r--r--core/java.mk3
-rw-r--r--core/main.mk3
-rw-r--r--core/package_internal.mk26
-rw-r--r--core/prebuilt_internal.mk35
-rw-r--r--core/product.mk1
-rw-r--r--core/product_config.mk16
-rw-r--r--core/tasks/apicheck.mk31
-rw-r--r--core/version_defaults.mk4
17 files changed, 233 insertions, 80 deletions
diff --git a/core/Makefile b/core/Makefile
index 49f48fc..05cda6e 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -183,6 +183,7 @@ ifneq ($(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_OEM_PROPERTIES),)
echo "import /oem/oem.prop $(prop)" >> $@;)
endif
$(hide) TARGET_BUILD_TYPE="$(TARGET_BUILD_VARIANT)" \
+ TARGET_BUILD_FLAVOR="$(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT)" \
TARGET_DEVICE="$(TARGET_DEVICE)" \
PRODUCT_NAME="$(TARGET_PRODUCT)" \
PRODUCT_BRAND="$(PRODUCT_BRAND)" \
@@ -488,6 +489,11 @@ ifeq ($(TARGET_BOOTIMAGE_USE_EXT2),true)
tmp_dir_for_image := $(call intermediates-dir-for,EXECUTABLES,boot_img)/bootimg
INTERNAL_BOOTIMAGE_ARGS += --tmpdir $(tmp_dir_for_image)
INTERNAL_BOOTIMAGE_ARGS += --genext2fs $(MKEXT2IMG)
+
+ifeq ($(TARGET_BOOTIMAGE_USE_EXTLINUX),true)
+INTERNAL_BOOTIMAGE_ARGS += --extlinuxconf $(TARGET_BOOTIMAGE_EXTLINUX_CONFIG)
+endif
+
$(INSTALLED_BOOTIMAGE_TARGET): $(MKEXT2IMG) $(INTERNAL_BOOTIMAGE_FILES)
$(call pretty,"Target boot image: $@")
$(hide) $(MKEXT2BOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) --output $@
@@ -502,14 +508,14 @@ else ifeq (true,$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VERITY)) # TARGE
$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES) $(BOOT_SIGNER)
$(call pretty,"Target boot image: $@")
$(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $@
- $(BOOT_SIGNER) /boot $@ $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VERITY_SIGNING_KEY) $@
+ $(BOOT_SIGNER) /boot $@ $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VERITY_SIGNING_KEY).pk8 $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VERITY_SIGNING_KEY).x509.pem $@
$(hide) $(call assert-max-image-size,$@,$(BOARD_BOOTIMAGE_PARTITION_SIZE))
.PHONY: bootimage-nodeps
bootimage-nodeps: $(MKBOOTIMG) $(BOOT_SIGNER)
@echo "make $@: ignoring dependencies"
$(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $(INSTALLED_BOOTIMAGE_TARGET)
- $(BOOT_SIGNER) /boot $(INSTALLED_BOOTIMAGE_TARGET) $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VERITY_SIGNING_KEY) $(INSTALLED_BOOTIMAGE_TARGET)
+ $(BOOT_SIGNER) /boot $(INSTALLED_BOOTIMAGE_TARGET) $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VERITY_SIGNING_KEY).pk8 $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VERITY_SIGNING_KEY).x509.pem $(INSTALLED_BOOTIMAGE_TARGET)
$(hide) $(call assert-max-image-size,$(INSTALLED_BOOTIMAGE_TARGET),$(BOARD_BOOTIMAGE_PARTITION_SIZE))
else # PRODUCT_SUPPORTS_VERITY != true
@@ -671,6 +677,13 @@ endif
endif
endif
+# These options tell the recovery updater/installer how to mount the partitions writebale.
+# <fstype>=<fstype_opts>[|<fstype_opts>]...
+# fstype_opts := <opt>[,<opt>]...
+# opt := <name>[=<value>]
+# The following worked on Nexus devices with Kernel 3.1, 3.4, 3.10
+DEFAULT_TARGET_RECOVERY_FSTYPE_MOUNT_OPTIONS := ext4=max_batch_time=0,commit=1,data=ordered,barrier=1,errors=panic,nodelalloc
+
ifneq (true,$(TARGET_USERIMAGES_SPARSE_EXT_DISABLED))
INTERNAL_USERIMAGES_SPARSE_EXT_FLAG := -s
endif
@@ -699,13 +712,16 @@ INTERNAL_USERIMAGES_DEPS += $(SELINUX_FC)
define generate-userimage-prop-dictionary
$(if $(INTERNAL_USERIMAGES_EXT_VARIANT),$(hide) echo "fs_type=$(INTERNAL_USERIMAGES_EXT_VARIANT)" >> $(1))
$(if $(BOARD_SYSTEMIMAGE_PARTITION_SIZE),$(hide) echo "system_size=$(BOARD_SYSTEMIMAGE_PARTITION_SIZE)" >> $(1))
+$(if $(BOARD_SYSTEMIMAGE_JOURNAL_SIZE),$(hide) echo "system_journal_size=$(BOARD_SYSTEMIMAGE_JOURNAL_SIZE)" >> $(1))
$(if $(BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE),$(hide) echo "userdata_fs_type=$(BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE)" >> $(1))
$(if $(BOARD_USERDATAIMAGE_PARTITION_SIZE),$(hide) echo "userdata_size=$(BOARD_USERDATAIMAGE_PARTITION_SIZE)" >> $(1))
$(if $(BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE),$(hide) echo "cache_fs_type=$(BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE)" >> $(1))
$(if $(BOARD_CACHEIMAGE_PARTITION_SIZE),$(hide) echo "cache_size=$(BOARD_CACHEIMAGE_PARTITION_SIZE)" >> $(1))
$(if $(BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE),$(hide) echo "vendor_fs_type=$(BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE)" >> $(1))
$(if $(BOARD_VENDORIMAGE_PARTITION_SIZE),$(hide) echo "vendor_size=$(BOARD_VENDORIMAGE_PARTITION_SIZE)" >> $(1))
+$(if $(BOARD_VENDORIMAGE_JOURNAL_SIZE),$(hide) echo "vendor_journal_size=$(BOARD_VENDORIMAGE_JOURNAL_SIZE)" >> $(1))
$(if $(BOARD_OEMIMAGE_PARTITION_SIZE),$(hide) echo "oem_size=$(BOARD_OEMIMAGE_PARTITION_SIZE)" >> $(1))
+$(if $(BOARD_OEMIMAGE_JOURNAL_SIZE),$(hide) echo "oem_journal_size=$(BOARD_OEMIMAGE_JOURNAL_SIZE)" >> $(1))
$(if $(INTERNAL_USERIMAGES_SPARSE_EXT_FLAG),$(hide) echo "extfs_sparse_flag=$(INTERNAL_USERIMAGES_SPARSE_EXT_FLAG)" >> $(1))
$(if $(mkyaffs2_extra_flags),$(hide) echo "mkyaffs2_extra_flags=$(mkyaffs2_extra_flags)" >> $(1))
$(hide) echo "selinux_fc=$(SELINUX_FC)" >> $(1)
@@ -739,12 +755,8 @@ ifneq (,$(PRODUCT_AAPT_PREF_CONFIG))
# If PRODUCT_AAPT_PREF_CONFIG includes a dpi bucket, then use that value.
recovery_density := $(filter %dpi,$(PRODUCT_AAPT_PREF_CONFIG))
else
-# Otherwise, use the highest density that appears in PRODUCT_AAPT_CONFIG.
-# Order is important here; we'll take the first one that's found.
-recovery_densities := $(filter $(PRODUCT_AAPT_CONFIG_SP),xxxhdpi xxhdpi xhdpi hdpi tvdpi mdpi ldpi)
-ifneq (,$(recovery_densities))
-recovery_density := $(word 1,$(recovery_densities))
-endif
+# Otherwise, use the default medium density.
+recovery_densities := mdpi
endif
ifneq (,$(wildcard $(recovery_resources_common)-$(recovery_density)))
@@ -854,7 +866,7 @@ $(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTFS) $(MKBOOTIMG) $(MINIGZIP) \
$(hide) $(MKBOOTFS) $(TARGET_RECOVERY_ROOT_OUT) | $(MINIGZIP) > $(recovery_ramdisk)
$(hide) $(MKBOOTIMG) $(INTERNAL_RECOVERYIMAGE_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $@
ifeq (true,$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VERITY))
- $(BOOT_SIGNER) /recovery $@ $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VERITY_SIGNING_KEY) $@
+ $(BOOT_SIGNER) /recovery $@ $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VERITY_SIGNING_KEY).pk8 $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VERITY_SIGNING_KEY).x509.pem $@
endif
$(hide) $(call assert-max-image-size,$@,$(BOARD_RECOVERYIMAGE_PARTITION_SIZE))
@echo ----- Made recovery image: $@ --------
@@ -1227,6 +1239,12 @@ vendorimage-nodeps: | $(INTERNAL_USERIMAGES_DEPS)
endif # BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE
# -----------------------------------------------------------------
+# bring in the installer image generation defines if necessary
+ifeq ($(TARGET_USE_DISKINSTALLER),true)
+include bootable/diskinstaller/config.mk
+endif
+
+# -----------------------------------------------------------------
# host tools needed to build dist and OTA packages
DISTTOOLS := $(HOST_OUT_EXECUTABLES)/minigzip \
@@ -1393,6 +1411,12 @@ endif
ifdef BOARD_RECOVERYIMAGE_PARTITION_SIZE
$(hide) echo "recovery_size=$(BOARD_RECOVERYIMAGE_PARTITION_SIZE)" >> $(zip_root)/META/misc_info.txt
endif
+ifdef TARGET_RECOVERY_FSTYPE_MOUNT_OPTIONS
+ @# TARGET_RECOVERY_FSTYPE_MOUNT_OPTIONS can be empty to indicate that nothing but defaults should be used.
+ $(hide) echo "recovery_mount_options=$(TARGET_RECOVERY_FSTYPE_MOUNT_OPTIONS)" >> $(zip_root)/META/misc_info.txt
+else
+ $(hide) echo "recovery_mount_options=$(DEFAULT_TARGET_RECOVERY_FSTYPE_MOUNT_OPTIONS)" >> $(zip_root)/META/misc_info.txt
+endif
$(hide) echo "tool_extensions=$(tool_extensions)" >> $(zip_root)/META/misc_info.txt
$(hide) echo "default_system_dev_certificate=$(DEFAULT_SYSTEM_DEV_CERTIFICATE)" >> $(zip_root)/META/misc_info.txt
ifdef PRODUCT_EXTRA_RECOVERY_KEYS
@@ -1402,6 +1426,7 @@ endif
$(hide) echo "use_set_metadata=1" >> $(zip_root)/META/misc_info.txt
$(hide) echo "multistage_support=1" >> $(zip_root)/META/misc_info.txt
$(hide) echo "update_rename_support=1" >> $(zip_root)/META/misc_info.txt
+ $(hide) echo "blockimgdiff_versions=1,2" >> $(zip_root)/META/misc_info.txt
ifneq ($(OEM_THUMBPRINT_PROPERTIES),)
# OTA scripts are only interested in fingerprint related properties
$(hide) echo "oem_fingerprint_properties=$(OEM_THUMBPRINT_PROPERTIES)" >> $(zip_root)/META/misc_info.txt
@@ -1494,10 +1519,14 @@ endif
name := $(name)-symbols-$(FILE_NAME_TAG)
SYMBOLS_ZIP := $(PRODUCT_OUT)/$(name).zip
+# For apps_only build we'll establish the dependency later in build/core/main.mk.
+ifndef TARGET_BUILD_APPS
$(SYMBOLS_ZIP): $(INSTALLED_SYSTEMIMAGE) $(INSTALLED_BOOTIMAGE_TARGET)
+endif
+$(SYMBOLS_ZIP):
@echo "Package symbols: $@"
$(hide) rm -rf $@
- $(hide) mkdir -p $(dir $@)
+ $(hide) mkdir -p $(dir $@) $(TARGET_OUT_UNSTRIPPED)
$(hide) zip -qr $@ $(TARGET_OUT_UNSTRIPPED)
# -----------------------------------------------------------------
diff --git a/core/android_manifest.mk b/core/android_manifest.mk
index 21b95c2..c641b75 100644
--- a/core/android_manifest.mk
+++ b/core/android_manifest.mk
@@ -11,13 +11,27 @@ else
full_android_manifest := $(LOCAL_PATH)/$(LOCAL_MANIFEST_FILE)
endif
+my_full_libs_manifest_files := $(LOCAL_FULL_LIBS_MANIFEST_FILES)
+my_full_libs_manifest_deps := $(LOCAL_FULL_LIBS_MANIFEST_FILES)
+
+# Set up dependency on aar libraries
+ifdef LOCAL_STATIC_JAVA_AAR_LIBRARIES
+my_full_libs_manifest_deps += $(foreach lib, $(LOCAL_STATIC_JAVA_AAR_LIBRARIES),\
+ $(call intermediates-dir-for,JAVA_LIBRARIES,$(lib),,COMMON)/aar/classes.jar)
+my_full_libs_manifest_files += $(foreach lib, $(LOCAL_STATIC_JAVA_AAR_LIBRARIES),\
+ $(call intermediates-dir-for,JAVA_LIBRARIES,$(lib),,COMMON)/aar/AndroidManifest.xml)
+
+LOCAL_RESOURCE_DIR += $(foreach lib, $(LOCAL_STATIC_JAVA_AAR_LIBRARIES),\
+ $(call intermediates-dir-for,JAVA_LIBRARIES,$(lib),,COMMON)/aar/res)
+endif
+
# Set up rules to merge library manifest files
-ifdef LOCAL_FULL_LIBS_MANIFEST_FILES
+ifdef my_full_libs_manifest_files
main_android_manifest := $(full_android_manifest)
full_android_manifest := $(intermediates.COMMON)/AndroidManifest.xml
-$(full_android_manifest): PRIVATE_LIBS_MANIFESTS := $(LOCAL_FULL_LIBS_MANIFEST_FILES)
-$(full_android_manifest) : $(main_android_manifest) $(LOCAL_FULL_LIBS_MANIFEST_FILES)
- @echo "Merge android manifest files: $@ <-- $^"
+$(full_android_manifest): PRIVATE_LIBS_MANIFESTS := $(my_full_libs_manifest_files)
+$(full_android_manifest) : $(main_android_manifest) $(my_full_libs_manifest_deps)
+ @echo "Merge android manifest files: $@ <-- $< $(PRIVATE_LIBS_MANIFESTS)"
@mkdir -p $(dir $@)
$(hide) $(ANDROID_MANIFEST_MERGER) --main $< --libs $(PRIVATE_LIBS_MANIFESTS) \
--out $@
diff --git a/core/apicheck_msg_current.txt b/core/apicheck_msg_current.txt
index 9abd381..440e7f8 100644
--- a/core/apicheck_msg_current.txt
+++ b/core/apicheck_msg_current.txt
@@ -7,7 +7,7 @@ To make these errors go away, you have two choices:
errors above.
2) You can update current.txt by executing the following command:
- make %UPDATE_API%
+ make update-api
To submit the revised current.txt to the main Android repository,
you will need approval.
diff --git a/core/binary.mk b/core/binary.mk
index 224f328..105082b 100644
--- a/core/binary.mk
+++ b/core/binary.mk
@@ -210,7 +210,9 @@ endif
####################################################
## Add FDO flags if FDO is turned on and supported
-####################################################
+## Please note that we will do option filtering during FDO build.
+## i.e. Os->O2, remove -fno-early-inline and -finline-limit.
+##################################################################
ifeq ($(strip $(LOCAL_FDO_SUPPORT)), true)
ifeq ($(strip $(LOCAL_IS_HOST_MODULE)),)
my_cflags += $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_FDO_CFLAGS)
@@ -990,6 +992,21 @@ my_asflags := $(call $(LOCAL_2ND_ARCH_VAR_PREFIX)convert-to-$(my_host)clang-flag
my_ldflags := $(call $(LOCAL_2ND_ARCH_VAR_PREFIX)convert-to-$(my_host)clang-flags,$(my_ldflags))
endif
+ifeq ($(LOCAL_FDO_SUPPORT), true)
+ build_with_fdo := false
+ ifeq ($(BUILD_FDO_INSTRUMENT), true)
+ build_with_fdo := true
+ endif
+ ifeq ($(BUILD_FDO_OPTIMIZE), true)
+ build_with_fdo := true
+ endif
+ ifeq ($(build_with_fdo), true)
+ my_cflags := $(patsubst -Os,-O2,$(my_cflags))
+ fdo_incompatible_flags=-fno-early-inlining -finline-limit=%
+ my_cflags := $(filter-out $(fdo_incompatible_flags),$(my_cflags))
+ endif
+endif
+
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_YACCFLAGS := $(LOCAL_YACCFLAGS)
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_ASFLAGS := $(my_asflags)
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_CONLYFLAGS := $(my_conlyflags)
diff --git a/core/cleanbuild.mk b/core/cleanbuild.mk
index 1bada38..cf980d8 100644
--- a/core/cleanbuild.mk
+++ b/core/cleanbuild.mk
@@ -132,23 +132,11 @@ endif # if not ONE_SHOT_MAKEFILE dont_bother
previous_build_config_file := $(PRODUCT_OUT)/previous_build_config.mk
-# TODO: this special case for the sdk is only necessary while "sdk"
-# is a valid make target. Eventually, it will just be a product, at
-# which point TARGET_PRODUCT will handle it and we can avoid this check
-# of MAKECMDGOALS. The "addprefix" is just to keep things pretty.
-ifneq ($(TARGET_PRODUCT),sdk)
- building_sdk := $(addprefix -,$(filter sdk,$(MAKECMDGOALS)))
-else
- # Don't bother with this extra part when explicitly building the sdk product.
- building_sdk :=
-endif
-
# A change in the list of aapt configs warrants an installclean, too.
aapt_config_list := $(strip $(PRODUCT_AAPT_CONFIG) $(PRODUCT_AAPT_PREF_CONFIG))
current_build_config := \
- $(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT)$(building_sdk)-{$(aapt_config_list)}
-building_sdk :=
+ $(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT)-{$(aapt_config_list)}
aapt_config_list :=
force_installclean := false
@@ -220,6 +208,7 @@ installclean_files := \
$(PRODUCT_OUT)/obj/JAVA_LIBRARIES \
$(PRODUCT_OUT)/obj/FAKE \
$(PRODUCT_OUT)/obj/EXECUTABLES/adbd_intermediates \
+ $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libfs_mgr_intermediates \
$(PRODUCT_OUT)/obj/EXECUTABLES/init_intermediates \
$(PRODUCT_OUT)/obj/ETC/mac_permissions.xml_intermediates \
$(PRODUCT_OUT)/obj/ETC/sepolicy_intermediates \
diff --git a/core/clear_vars.mk b/core/clear_vars.mk
index 9f339ff..5c1a58d 100644
--- a/core/clear_vars.mk
+++ b/core/clear_vars.mk
@@ -30,6 +30,7 @@ LOCAL_MODULE_TAGS:=
LOCAL_SRC_FILES:=
LOCAL_PREBUILT_OBJ_FILES:=
LOCAL_STATIC_JAVA_LIBRARIES:=
+LOCAL_STATIC_JAVA_AAR_LIBRARIES:=
LOCAL_STATIC_LIBRARIES:=
# Group static libraries with "-Wl,--start-group" and "-Wl,--end-group" when linking.
LOCAL_GROUP_STATIC_LIBRARIES:=
@@ -167,6 +168,8 @@ LOCAL_MODULE_HOST_ARCH:=
LOCAL_NO_FPIE :=
LOCAL_CXX_STL := default
LOCAL_NATIVE_COVERAGE :=
+LOCAL_DPI_VARIANTS:=
+LOCAL_DPI_FILE_STEM:=
# arch specific variables
LOCAL_SRC_FILES_$(TARGET_ARCH):=
diff --git a/core/combo/HOST_windows-x86.mk b/core/combo/HOST_windows-x86.mk
index d4acfe9..b71ac16 100644
--- a/core/combo/HOST_windows-x86.mk
+++ b/core/combo/HOST_windows-x86.mk
@@ -27,7 +27,7 @@ ifneq ($(findstring Linux,$(UNAME)),)
ifdef USE_MINGW
HOST_ACP_UNAVAILABLE := true
TOOLS_EXE_SUFFIX :=
-$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -DUSE_MINGW
+$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -DUSE_MINGW -DWIN32_LEAN_AND_MEAN
$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -Wno-unused-parameter
$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += --sysroot=prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8/x86_64-w64-mingw32
$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -m32
diff --git a/core/dpi_specific_apk.mk b/core/dpi_specific_apk.mk
new file mode 100644
index 0000000..aad4713
--- /dev/null
+++ b/core/dpi_specific_apk.mk
@@ -0,0 +1,70 @@
+# Set up rules to build dpi-specific apk, with whatever else from the base apk.
+# Input variable: my_dpi, and all other variables set up in package_internal.mk.
+#
+
+dpi_apk_name := $(LOCAL_MODULE)_$(my_dpi)
+dpi_intermediate := $(call intermediates-dir-for,APPS,$(dpi_apk_name))
+built_dpi_apk := $(dpi_intermediate)/package.apk
+
+# Set up all the target-specific variables.
+$(built_dpi_apk): PRIVATE_MODULE := $(dpi_apk_name)
+$(built_dpi_apk): PRIVATE_AAPT_FLAGS := $(LOCAL_AAPT_FLAGS) $(PRODUCT_AAPT_FLAGS)
+# Clear PRIVATE_PRODUCT_AAPT_CONFIG to include everything by default.
+$(built_dpi_apk): PRIVATE_PRODUCT_AAPT_CONFIG :=
+$(built_dpi_apk): PRIVATE_PRODUCT_AAPT_PREF_CONFIG := $(my_dpi)
+$(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)))
+$(built_dpi_apk): PRIVATE_DEFAULT_APP_TARGET_SDK := $(LOCAL_SDK_VERSION)
+else
+$(built_dpi_apk): PRIVATE_DEFAULT_APP_TARGET_SDK := $(DEFAULT_APP_TARGET_SDK)
+endif
+$(built_dpi_apk): PRIVATE_MANIFEST_PACKAGE_NAME := $(LOCAL_MANIFEST_PACKAGE_NAME)
+$(built_dpi_apk): PRIVATE_MANIFEST_INSTRUMENTATION_FOR := $(LOCAL_INSTRUMENTATION_FOR)
+$(built_dpi_apk): PRIVATE_JNI_SHARED_LIBRARIES := $(jni_shared_libraries_with_abis)
+$(built_dpi_apk): PRIVATE_JNI_SHARED_LIBRARIES_ABI := $(jni_shared_libraries_abis)
+$(built_dpi_apk): PRIVATE_DEX_FILE := $(built_dex)
+# Note that PRIVATE_CLASS_INTERMEDIATES_DIR points to the base apk's intermediate dir.
+$(built_dpi_apk): PRIVATE_CLASS_INTERMEDIATES_DIR := $(intermediates)/classes
+$(built_dpi_apk): PRIVATE_EXTRA_JAR_ARGS := $(extra_jar_args)
+$(built_dpi_apk): PRIVATE_PRIVATE_KEY := $(private_key)
+$(built_dpi_apk): PRIVATE_CERTIFICATE := $(certificate)
+$(built_dpi_apk): PRIVATE_ADDITIONAL_CERTIFICATES := $(foreach c,\
+ $(LOCAL_ADDITIONAL_CERTIFICATES), $(c).x509.pem $(c).pk8)
+
+# Set up dependenncies and the build recipe.
+$(built_dpi_apk) : $(R_file_stamp)
+$(built_dpi_apk) : $(all_library_res_package_export_deps)
+$(built_dpi_apk) : $(built_dex)
+$(built_dpi_apk) : $(private_key) $(certificate) $(SIGNAPK_JAR)
+$(built_dpi_apk) : $(AAPT) | $(ZIPALIGN)
+$(built_dpi_apk) : $(all_res_assets) $(jni_shared_libraries) $(full_android_manifest)
+ @echo "target Package: $(PRIVATE_MODULE) ($@)"
+ $(create-empty-package)
+ $(add-assets-to-package)
+ifneq ($(jni_shared_libraries),)
+ $(add-jni-shared-libs-to-package)
+endif
+ifneq ($(full_classes_jar),)
+ $(add-dex-to-package)
+endif
+ $(add-carried-java-resources)
+ifneq ($(extra_jar_args),)
+ $(add-java-resources-to-package)
+endif
+ $(sign-package)
+ $(align-package)
+
+# Set up global variables to register this apk to the higher-level dependency graph.
+ALL_MODULES += $(dpi_apk_name)
+ALL_MODULES.$(dpi_apk_name).CLASS := APPS
+ALL_MODULES.$(dpi_apk_name).BUILT := $(built_dpi_apk)
+PACKAGES := $(PACKAGES) $(dpi_apk_name)
+PACKAGES.$(dpi_apk_name).PRIVATE_KEY := $(private_key)
+PACKAGES.$(dpi_apk_name).CERTIFICATE := $(certificate)
+
+# Phony targets used by "apps_only".
+.PHONY: $(dpi_apk_name)
+$(dpi_apk_name) : $(built_dpi_apk)
diff --git a/core/dynamic_binary.mk b/core/dynamic_binary.mk
index 3d6ad4a..08fb176 100644
--- a/core/dynamic_binary.mk
+++ b/core/dynamic_binary.mk
@@ -17,16 +17,13 @@ endif
# know its results before base_rules.mk is included.
include $(BUILD_SYSTEM)/configure_module_stem.mk
-# base_rules.make defines $(intermediates), but we need its value
-# before we include base_rules. Make a guess, and verify that
-# it's correct once the real value is defined.
-guessed_intermediates := $(call local-intermediates-dir,,$(LOCAL_2ND_ARCH_VAR_PREFIX))
+intermediates := $(call local-intermediates-dir,,$(LOCAL_2ND_ARCH_VAR_PREFIX))
# Define the target that is the unmodified output of the linker.
# The basename of this target must be the same as the final output
# binary name, because it's used to set the "soname" in the binary.
# The includer of this file will define a rule to build this target.
-linked_module := $(guessed_intermediates)/LINKED/$(my_built_module_stem)
+linked_module := $(intermediates)/LINKED/$(my_built_module_stem)
ALL_ORIGINAL_DYNAMIC_BINARIES += $(linked_module)
@@ -41,11 +38,6 @@ LOCAL_INTERMEDIATE_TARGETS := $(linked_module)
include $(BUILD_SYSTEM)/binary.mk
###################################
-# Make sure that our guess at the value of intermediates was correct.
-ifneq ($(intermediates),$(guessed_intermediates))
-$(error Internal error: guessed path '$(guessed_intermediates)' doesn't match '$(intermediates))
-endif
-
###########################################################
## Compress
###########################################################
diff --git a/core/java.mk b/core/java.mk
index 80bf530..c47ea22 100644
--- a/core/java.mk
+++ b/core/java.mk
@@ -52,6 +52,9 @@ else
endif
endif
+# LOCAL_STATIC_JAVA_AAR_LIBRARIES are special LOCAL_STATIC_JAVA_LIBRARIES
+LOCAL_STATIC_JAVA_LIBRARIES := $(strip $(LOCAL_STATIC_JAVA_LIBRARIES) $(LOCAL_STATIC_JAVA_AAR_LIBRARIES))
+
LOCAL_JAVA_LIBRARIES := $(sort $(LOCAL_JAVA_LIBRARIES))
LOCAL_BUILT_MODULE_STEM := $(strip $(LOCAL_BUILT_MODULE_STEM))
diff --git a/core/main.mk b/core/main.mk
index a0a0a59..48a7ba6 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -927,6 +927,9 @@ ifneq ($(TARGET_BUILD_APPS),)
$(PROGUARD_DICT_ZIP) : $(apps_only_installed_files)
$(call dist-for-goals,apps_only, $(PROGUARD_DICT_ZIP))
+ $(SYMBOLS_ZIP) : $(apps_only_installed_files)
+ $(call dist-for-goals,apps_only, $(SYMBOLS_ZIP))
+
.PHONY: apps_only
apps_only: $(unbundled_build_modules)
diff --git a/core/package_internal.mk b/core/package_internal.mk
index 58db27d..e16c68f 100644
--- a/core/package_internal.mk
+++ b/core/package_internal.mk
@@ -123,7 +123,8 @@ endif
all_res_assets := $(strip $(all_assets) $(all_resources))
-package_expected_intermediates_COMMON := $(call local-intermediates-dir,COMMON)
+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.
ifneq (true,$(need_compile_asset))
@@ -136,7 +137,7 @@ else
# Make sure that R_file_stamp inherits the proper PRIVATE vars.
# If R.stamp moves, be sure to update the framework makefile,
# which has intimate knowledge of its location.
-R_file_stamp := $(package_expected_intermediates_COMMON)/src/R.stamp
+R_file_stamp := $(intermediates.COMMON)/src/R.stamp
LOCAL_INTERMEDIATE_TARGETS += $(R_file_stamp)
endif
@@ -156,7 +157,7 @@ endif
proguard_options_file :=
ifneq ($(LOCAL_PROGUARD_ENABLED),custom)
ifeq ($(need_compile_res),true)
- proguard_options_file := $(package_expected_intermediates_COMMON)/proguard_options
+ proguard_options_file := $(intermediates.COMMON)/proguard_options
endif # need_compile_res
endif # !custom
LOCAL_PROGUARD_FLAGS := $(addprefix -include ,$(proguard_options_file)) $(LOCAL_PROGUARD_FLAGS)
@@ -192,6 +193,8 @@ endif # LOCAL_EMMA_INSTRUMENT
rs_compatibility_jni_libs :=
+include $(BUILD_SYSTEM)/android_manifest.mk
+
#################################
include $(BUILD_SYSTEM)/java.mk
#################################
@@ -201,8 +204,6 @@ ifeq ($(LOCAL_SDK_RES_VERSION),)
LOCAL_SDK_RES_VERSION:=$(LOCAL_SDK_VERSION)
endif
-include $(BUILD_SYSTEM)/android_manifest.mk
-
$(LOCAL_INTERMEDIATE_TARGETS): \
PRIVATE_ANDROID_MANIFEST := $(full_android_manifest)
ifneq (,$(filter-out current system_current, $(LOCAL_SDK_VERSION)))
@@ -223,11 +224,6 @@ ifeq ($(need_compile_res),true)
# At the same time, this will copy the R.java file to a central
# 'R' directory to make it easier to add the files to an IDE.
#
-#TODO: use PRIVATE_SOURCE_INTERMEDIATES_DIR instead of
-# $(intermediates.COMMON)/src
-ifneq ($(package_expected_intermediates_COMMON),$(intermediates.COMMON))
- $(error $(LOCAL_MODULE): internal error: expected intermediates.COMMON "$(package_expected_intermediates_COMMON)" != intermediates.COMMON "$(intermediates.COMMON)")
-endif
$(R_file_stamp): PRIVATE_RESOURCE_PUBLICS_OUTPUT := \
$(intermediates.COMMON)/public_resources.xml
@@ -410,6 +406,16 @@ endif
$(align-package)
###############################
+## Build dpi-specific apks, if it's apps_only build.
+ifdef TARGET_BUILD_APPS
+ifdef LOCAL_DPI_VARIANTS
+$(foreach d, $(LOCAL_DPI_VARIANTS), \
+ $(eval my_dpi := $(d)) \
+ $(eval include $(BUILD_SYSTEM)/dpi_specific_apk.mk))
+endif
+endif
+
+###############################
## Rule to build the odex file
ifdef LOCAL_DEX_PREOPT
$(built_odex): PRIVATE_DEX_FILE := $(built_dex)
diff --git a/core/prebuilt_internal.mk b/core/prebuilt_internal.mk
index 2e0d2ef..e486531 100644
--- a/core/prebuilt_internal.mk
+++ b/core/prebuilt_internal.mk
@@ -117,6 +117,19 @@ endif # LOCAL_STRIP_MODULE not true
ifeq ($(LOCAL_MODULE_CLASS),APPS)
PACKAGES.$(LOCAL_MODULE).OVERRIDES := $(strip $(LOCAL_OVERRIDES_PACKAGES))
+# Select dpi-specific source
+ifdef LOCAL_DPI_VARIANTS
+my_dpi := $(firstword $(filter $(LOCAL_DPI_VARIANTS),$(PRODUCT_AAPT_PREF_CONFIG) $(PRODUCT_AAPT_PREBUILT_DPI)))
+ifdef my_dpi
+ifdef LOCAL_DPI_FILE_STEM
+my_prebuilt_dpi_file_stem := $(LOCAL_DPI_FILE_STEM)
+else
+my_prebuilt_dpi_file_stem := $(LOCAL_MODULE)_%.apk
+endif
+my_prebuilt_src_file := $(dir $(my_prebuilt_src_file))$(subst %,$(my_dpi),$(my_prebuilt_dpi_file_stem))
+endif # my_dpi
+endif # LOCAL_DPI_VARIANTS
+
rs_compatibility_jni_libs :=
include $(BUILD_SYSTEM)/install_jni_libs.mk
@@ -250,10 +263,26 @@ ifeq ($(LOCAL_IS_HOST_MODULE)$(LOCAL_MODULE_CLASS),JAVA_LIBRARIES)
# while the deps should be in the common dir, so we make a copy in the common dir.
# For nonstatic library, $(common_javalib_jar) is the dependency file,
# while $(common_classes_jar) is used to link.
-common_classes_jar := $(call intermediates-dir-for,JAVA_LIBRARIES,$(LOCAL_MODULE),,COMMON)/classes.jar
-common_javalib_jar := $(dir $(common_classes_jar))javalib.jar
+common_classes_jar := $(intermediates.COMMON)/classes.jar
+common_javalib_jar := $(intermediates.COMMON)/javalib.jar
+
+$(common_classes_jar) $(common_javalib_jar): PRIVATE_MODULE := $(LOCAL_MODULE)
+
+ifneq ($(filter %.aar, $(my_prebuilt_src_file)),)
+# This is .aar file, archive of classes.jar and Android resources.
+my_src_jar := $(intermediates.COMMON)/aar/classes.jar
-$(common_classes_jar) : $(my_prebuilt_src_file) | $(ACP)
+$(my_src_jar) : $(my_prebuilt_src_file)
+ $(hide) rm -rf $(dir $@) && mkdir -p $(dir $@)
+ $(hide) unzip -qo -d $(dir $@) $<
+ # Make sure the extracted classes.jar has a new timestamp.
+ $(hide) touch $@
+
+else
+# This is jar file.
+my_src_jar := $(my_prebuilt_src_file)
+endif
+$(common_classes_jar) : $(my_src_jar) | $(ACP)
$(transform-prebuilt-to-target)
$(common_javalib_jar) : $(common_classes_jar) | $(ACP)
diff --git a/core/product.mk b/core/product.mk
index 166b583..3c0bfc3 100644
--- a/core/product.mk
+++ b/core/product.mk
@@ -70,6 +70,7 @@ _product_var_list := \
PRODUCT_LOCALES \
PRODUCT_AAPT_CONFIG \
PRODUCT_AAPT_PREF_CONFIG \
+ PRODUCT_AAPT_PREBUILT_DPI \
PRODUCT_PACKAGES \
PRODUCT_PACKAGES_DEBUG \
PRODUCT_PACKAGES_ENG \
diff --git a/core/product_config.mk b/core/product_config.mk
index 019a61c..5240ae7 100644
--- a/core/product_config.mk
+++ b/core/product_config.mk
@@ -274,19 +274,9 @@ ifneq (,$(extra_locales))
endif
# Add PRODUCT_LOCALES to PRODUCT_AAPT_CONFIG
-PRODUCT_AAPT_CONFIG := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_AAPT_CONFIG))
-PRODUCT_AAPT_CONFIG := $(PRODUCT_LOCALES) $(PRODUCT_AAPT_CONFIG)
+PRODUCT_AAPT_CONFIG := $(strip $(PRODUCT_LOCALES) $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_AAPT_CONFIG))
PRODUCT_AAPT_PREF_CONFIG := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_AAPT_PREF_CONFIG))
-
-# Default to medium-density assets.
-# (Can be overridden in the device config, e.g.: PRODUCT_AAPT_CONFIG += hdpi)
-PRODUCT_AAPT_CONFIG := $(strip \
- $(PRODUCT_AAPT_CONFIG) \
- $(if $(filter %dpi,$(PRODUCT_AAPT_CONFIG)),,mdpi))
-PRODUCT_AAPT_PREF_CONFIG := $(strip $(PRODUCT_AAPT_PREF_CONFIG))
-
-# Everyone gets nodpi and anydpi assets which are density-independent.
-PRODUCT_AAPT_CONFIG += nodpi anydpi
+PRODUCT_AAPT_PREBUILT_DPI := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_AAPT_PREBUILT_DPI))
# Keep a copy of the space-separated config
PRODUCT_AAPT_CONFIG_SP := $(PRODUCT_AAPT_CONFIG)
@@ -294,8 +284,6 @@ PRODUCT_AAPT_CONFIG_SP := $(PRODUCT_AAPT_CONFIG)
# Convert spaces to commas.
PRODUCT_AAPT_CONFIG := \
$(subst $(space),$(comma),$(strip $(PRODUCT_AAPT_CONFIG)))
-PRODUCT_AAPT_PREF_CONFIG := \
- $(subst $(space),$(comma),$(strip $(PRODUCT_AAPT_PREF_CONFIG)))
# product-scoped aapt flags
PRODUCT_AAPT_FLAGS :=
diff --git a/core/tasks/apicheck.mk b/core/tasks/apicheck.mk
index fc98f5b..683a075 100644
--- a/core/tasks/apicheck.mk
+++ b/core/tasks/apicheck.mk
@@ -31,6 +31,11 @@ last_released_sdk_version := $(lastword $(call numerically_sort, \
)\
))
+.PHONY: check-public-api
+checkapi : check-public-api
+
+.PHONY: update-api
+
# INTERNAL_PLATFORM_API_FILE is the one build by droiddoc.
# Note that since INTERNAL_PLATFORM_API_FILE is the byproduct of api-stubs module,
# (See frameworks/base/Android.mk)
@@ -39,7 +44,7 @@ last_released_sdk_version := $(lastword $(call numerically_sort, \
# Check that the API we're building hasn't broken the last-released
# SDK version.
$(eval $(call check-api, \
- checkapi-last, \
+ checkpublicapi-last, \
$(SRC_API_DIR)/$(last_released_sdk_version).txt, \
$(INTERNAL_PLATFORM_API_FILE), \
frameworks/base/api/removed.txt, \
@@ -48,14 +53,14 @@ $(eval $(call check-api, \
-error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \
-error 16 -error 17 -error 18 , \
cat $(BUILD_SYSTEM)/apicheck_msg_last.txt, \
- checkapi, \
+ check-public-api, \
$(call doc-timestamp-for,api-stubs) \
))
# Check that the API we're building hasn't changed from the not-yet-released
# SDK version.
$(eval $(call check-api, \
- checkapi-current, \
+ checkpublicapi-current, \
frameworks/base/api/current.txt, \
$(INTERNAL_PLATFORM_API_FILE), \
frameworks/base/api/removed.txt, \
@@ -64,21 +69,23 @@ $(eval $(call check-api, \
-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, \
- sed -e 's/%UPDATE_API%/update-api/g' $(BUILD_SYSTEM)/apicheck_msg_current.txt, \
- checkapi, \
+ cat $(BUILD_SYSTEM)/apicheck_msg_current.txt, \
+ check-public-api, \
$(call doc-timestamp-for,api-stubs) \
))
-.PHONY: update-api
-update-api: $(INTERNAL_PLATFORM_API_FILE) | $(ACP)
+.PHONY: update-public-api
+update-public-api: $(INTERNAL_PLATFORM_API_FILE) | $(ACP)
@echo Copying current.txt
$(hide) $(ACP) $(INTERNAL_PLATFORM_API_FILE) frameworks/base/api/current.txt
@echo Copying removed.txt
$(hide) $(ACP) $(INTERNAL_PLATFORM_REMOVED_API_FILE) frameworks/base/api/removed.txt
+update-api : update-public-api
#####################Check System API#####################
-.PHONY: checksystemapi
+.PHONY: check-system-api
+checkapi : check-system-api
# Check that the System API we're building hasn't broken the last-released
# SDK version.
@@ -92,7 +99,7 @@ $(eval $(call check-api, \
-error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \
-error 16 -error 17 -error 18 , \
cat $(BUILD_SYSTEM)/apicheck_msg_last.txt, \
- checksystemapi, \
+ check-system-api, \
$(call doc-timestamp-for,system-api-stubs) \
))
@@ -108,12 +115,14 @@ $(eval $(call check-api, \
-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, \
- sed -e 's/%UPDATE_API%/update-system-api/g' $(BUILD_SYSTEM)/apicheck_msg_current.txt, \
- checksystemapi, \
+ cat $(BUILD_SYSTEM)/apicheck_msg_current.txt, \
+ check-system-api, \
$(call doc-timestamp-for,system-api-stubs) \
))
.PHONY: update-system-api
+update-api : update-system-api
+
update-system-api: $(INTERNAL_PLATFORM_SYSTEM_API_FILE) | $(ACP)
@echo Copying system-current.txt
$(hide) $(ACP) $(INTERNAL_PLATFORM_SYSTEM_API_FILE) frameworks/base/api/system-current.txt
diff --git a/core/version_defaults.mk b/core/version_defaults.mk
index d2bef14..d87a032 100644
--- a/core/version_defaults.mk
+++ b/core/version_defaults.mk
@@ -41,7 +41,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 := 5.0.50.50.50.50
+ PLATFORM_VERSION := 5.1
endif
ifeq "" "$(PLATFORM_SDK_VERSION)"
@@ -53,7 +53,7 @@ ifeq "" "$(PLATFORM_SDK_VERSION)"
# intermediate builds). During development, this number remains at the
# SDK version the branch is based on and PLATFORM_VERSION_CODENAME holds
# the code-name of the new development work.
- PLATFORM_SDK_VERSION := 21
+ PLATFORM_SDK_VERSION := 22
endif
ifeq "" "$(PLATFORM_VERSION_CODENAME)"