Merge "Remove webviewchromium from PRODUCT_BOOT_JARS." into lmp-dev
diff --git a/.gitignore b/.gitignore
index 0d20b64..c9b568f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
*.pyc
+*.swp
diff --git a/CleanSpec.mk b/CleanSpec.mk
index 7175b0e..4e90c90 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -281,6 +281,8 @@
# dalvik.vm.image-dex2oat-Xms, and dalvik.vm.image-dex2oat-Xmx
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/root/default.prop)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/recovery/root/default.prop)
+
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system)
# ************************************************
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
# ************************************************
diff --git a/core/Makefile b/core/Makefile
index b81aac2..c556ed7 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -111,7 +111,14 @@
# The string used to uniquely identify the combined build and product; used by the OTA server.
ifeq (,$(strip $(BUILD_FINGERPRINT)))
- BUILD_FINGERPRINT := $(PRODUCT_BRAND)/$(TARGET_PRODUCT)/$(TARGET_DEVICE):$(PLATFORM_VERSION)/$(BUILD_ID)/$(BUILD_NUMBER):$(TARGET_BUILD_VARIANT)/$(BUILD_VERSION_TAGS)
+ ifneq ($(filter eng.%,$(BUILD_NUMBER)),)
+ # Trim down BUILD_FINGERPRINT: the default BUILD_NUMBER makes it easily exceed
+ # the Android system property length limit (PROPERTY_VALUE_MAX=92).
+ BF_BUILD_NUMBER := $(USER)$(shell date +%m%d%H%M)
+ else
+ BF_BUILD_NUMBER := $(BUILD_NUMBER)
+ endif
+ BUILD_FINGERPRINT := $(PRODUCT_BRAND)/$(TARGET_PRODUCT)/$(TARGET_DEVICE):$(PLATFORM_VERSION)/$(BUILD_ID)/$(BF_BUILD_NUMBER):$(TARGET_BUILD_VARIANT)/$(BUILD_VERSION_TAGS)
endif
ifneq ($(words $(BUILD_FINGERPRINT)),1)
$(error BUILD_FINGERPRINT cannot contain spaces: "$(BUILD_FINGERPRINT)")
@@ -236,6 +243,22 @@
build_desc :=
# -----------------------------------------------------------------
+# vendor build.prop
+#
+# For verifying that the vendor build is what we thing it is
+ifdef BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE
+INSTALLED_VENDOR_BUILD_PROP_TARGET := $(TARGET_OUT_VENDOR)/build.prop
+ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_VENDOR_BUILD_PROP_TARGET)
+$(INSTALLED_VENDOR_BUILD_PROP_TARGET): $(INSTALLED_BUILD_PROP_TARGET)
+ @echo Target vendor buildinfo: $@
+ @mkdir -p $(dir $@)
+ $(hide) echo > $@
+ $(hide) echo ro.vendor.build.date=`date`>>$@
+ $(hide) echo ro.vendor.build.date.utc=`date +%s`>>$@
+ $(hide) echo ro.vendor.build.fingerprint="$(BUILD_FINGERPRINT)">>$@
+endif
+
+# -----------------------------------------------------------------
# sdk-build.prop
#
# There are certain things in build.prop that we don't want to
@@ -1392,6 +1415,7 @@
$(hide) zipinfo -1 $@ | awk 'BEGIN { FS="BOOT/RAMDISK/" } /^BOOT\/RAMDISK\// {print $$2}' | $(HOST_OUT_EXECUTABLES)/fs_config -C -S $(SELINUX_FC) > $(zip_root)/META/boot_filesystem_config.txt
$(hide) zipinfo -1 $@ | awk 'BEGIN { FS="RECOVERY/RAMDISK/" } /^RECOVERY\/RAMDISK\// {print $$2}' | $(HOST_OUT_EXECUTABLES)/fs_config -C -S $(SELINUX_FC) > $(zip_root)/META/recovery_filesystem_config.txt
$(hide) (cd $(zip_root) && zip -q ../$(notdir $@) META/*filesystem_config.txt)
+ $(hide) ./build/tools/releasetools/add_img_to_target_files $@
.PHONY: target-files-package
target-files-package: $(BUILT_TARGET_FILES_PACKAGE)
@@ -1489,7 +1513,7 @@
@echo "Package apps: $@"
$(hide) rm -rf $@
$(hide) mkdir -p $(dir $@)
- $(hide) zip -qj $@ $(TARGET_OUT_APPS)/* $(TARGET_OUT_APPS_PRIVILEGED)/*
+ $(hide) zip -qj $@ $(TARGET_OUT_APPS)/*/*.apk $(TARGET_OUT_APPS_PRIVILEGED)/*/*.apk
#------------------------------------------------------------------
@@ -1594,7 +1618,6 @@
ATREE_FILES := \
$(ALL_PREBUILT) \
$(ALL_COPIED_HEADERS) \
- $(ALL_GENERATED_SOURCES) \
$(ALL_DEFAULT_INSTALLED_MODULES) \
$(INSTALLED_RAMDISK_TARGET) \
$(ALL_DOCS) \
diff --git a/core/base_rules.mk b/core/base_rules.mk
index a4f1360..7663ee2 100644
--- a/core/base_rules.mk
+++ b/core/base_rules.mk
@@ -176,9 +176,15 @@
built_module_path := $(intermediates)
endif
LOCAL_BUILT_MODULE := $(built_module_path)/$(my_built_module_stem)
-built_module_path :=
ifneq (true,$(LOCAL_UNINSTALLABLE_MODULE))
+ # Apk and its attachments reside in its own subdir.
+ ifeq ($(LOCAL_MODULE_CLASS),APPS)
+ # framework-res.apk doesn't like the additional layer.
+ ifneq ($(LOCAL_NO_STANDARD_LIBRARIES),true)
+ my_module_path := $(my_module_path)/$(LOCAL_MODULE)
+ endif
+ endif
LOCAL_INSTALLED_MODULE := $(my_module_path)/$(my_installed_module_stem)
endif
@@ -200,12 +206,12 @@
aidl_preprocess_import :=
LOCAL_SDK_VERSION:=$(strip $(LOCAL_SDK_VERSION))
ifdef LOCAL_SDK_VERSION
-ifeq ($(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS),current)
+ifneq ($(filter current system_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
aidl_preprocess_import := $(HISTORICAL_SDK_VERSIONS_ROOT)/$(LOCAL_SDK_VERSION)/framework.aidl
-endif # !current
+endif # not current or system_current
else
# build against the platform.
LOCAL_AIDL_INCLUDES += $(FRAMEWORKS_BASE_JAVA_SRC_DIRS)
@@ -388,9 +394,11 @@
ifeq ($(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS),current)
# LOCAL_SDK_VERSION is current and no TARGET_BUILD_APPS.
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_BOOTCLASSPATH := -bootclasspath $(call java-lib-files,android_stubs_current)
+else ifeq ($(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS),system_current)
+$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_BOOTCLASSPATH := -bootclasspath $(call java-lib-files,android_system_stubs_current)
else
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_BOOTCLASSPATH := -bootclasspath $(call java-lib-files,sdk_v$(LOCAL_SDK_VERSION))
-endif # current
+endif # current or system_current
endif # LOCAL_SDK_VERSION
endif # TARGET_
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_RESOURCE_DIR := $(LOCAL_RESOURCE_DIR)
diff --git a/core/binary.mk b/core/binary.mk
index be0776e..f5dac69 100644
--- a/core/binary.mk
+++ b/core/binary.mk
@@ -179,7 +179,6 @@
ifneq ($(strip $(LOCAL_FDO_SUPPORT)),)
ifeq ($(strip $(LOCAL_IS_HOST_MODULE)),)
my_cflags += $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_FDO_CFLAGS)
- my_cppflags += $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_FDO_CFLAGS)
my_ldflags += $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_FDO_CFLAGS)
endif
endif
diff --git a/core/clang/config.mk b/core/clang/config.mk
index 1de46f0..c1625f2 100644
--- a/core/clang/config.mk
+++ b/core/clang/config.mk
@@ -17,6 +17,17 @@
CLANG_TBLGEN := $(HOST_OUT_EXECUTABLES)/clang-tblgen$(BUILD_EXECUTABLE_SUFFIX)
LLVM_TBLGEN := $(HOST_OUT_EXECUTABLES)/llvm-tblgen$(BUILD_EXECUTABLE_SUFFIX)
+# The C/C++ compiler can be wrapped by setting the CC/CXX_WRAPPER vars.
+ifdef CC_WRAPPER
+ ifneq ($(CC_WRAPPER),$(firstword $(CLANG)))
+ CLANG := $(CC_WRAPPER) $(CLANG)
+ endif
+endif
+ifdef CXX_WRAPPER
+ ifneq ($(CXX_WRAPPER),$(firstword $(CLANG_CXX)))
+ CLANG_CXX := $(CXX_WRAPPER) $(CLANG_CXX)
+ endif
+endif
# Clang flags for all host or target rules
CLANG_CONFIG_EXTRA_ASFLAGS :=
diff --git a/core/cleanbuild.mk b/core/cleanbuild.mk
index 0932aa1..1bada38 100644
--- a/core/cleanbuild.mk
+++ b/core/cleanbuild.mk
@@ -214,6 +214,8 @@
$(PRODUCT_OUT)/recovery \
$(PRODUCT_OUT)/root \
$(PRODUCT_OUT)/system \
+ $(PRODUCT_OUT)/vendor \
+ $(PRODUCT_OUT)/oem \
$(PRODUCT_OUT)/dex_bootjars \
$(PRODUCT_OUT)/obj/JAVA_LIBRARIES \
$(PRODUCT_OUT)/obj/FAKE \
diff --git a/core/clear_vars.mk b/core/clear_vars.mk
index 4fd2888..f23c4a6 100644
--- a/core/clear_vars.mk
+++ b/core/clear_vars.mk
@@ -23,6 +23,7 @@
LOCAL_OVERRIDES_PACKAGES:=
LOCAL_EXPORT_PACKAGE_RESOURCES:=
LOCAL_MANIFEST_PACKAGE_NAME:=
+LOCAL_PACKAGE_SPLITS:=
LOCAL_REQUIRED_MODULES:=
LOCAL_ACP_UNAVAILABLE:=
LOCAL_MODULE_TAGS:=
diff --git a/core/combo/HOST_linux-x86.mk b/core/combo/HOST_linux-x86.mk
index c931937..3ca7443 100644
--- a/core/combo/HOST_linux-x86.mk
+++ b/core/combo/HOST_linux-x86.mk
@@ -31,7 +31,7 @@
$(combo_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG := prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/
# We expect SSE3 floating point math.
-$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -mstackrealign -msse3 -mfpmath=sse -m32 -Wa,--noexecstack
+$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -mstackrealign -msse3 -mfpmath=sse -m32 -Wa,--noexecstack -march=prescott
$(combo_2nd_arch_prefix)HOST_GLOBAL_LDFLAGS += -m32 -Wl,-z,noexecstack
ifneq ($(strip $(BUILD_HOST_static)),)
diff --git a/core/combo/TARGET_linux-arm.mk b/core/combo/TARGET_linux-arm.mk
index 37c56dc..702a366 100644
--- a/core/combo/TARGET_linux-arm.mk
+++ b/core/combo/TARGET_linux-arm.mk
@@ -49,6 +49,7 @@
endif
include $(TARGET_ARCH_SPECIFIC_MAKEFILE)
+include $(BUILD_SYSTEM)/combo/fdo.mk
# You can set TARGET_TOOLS_PREFIX to get gcc from somewhere else
ifeq ($(strip $($(combo_2nd_arch_prefix)TARGET_TOOLS_PREFIX)),)
@@ -164,39 +165,8 @@
$($(combo_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS) -print-libgcc-file-name)
$(combo_2nd_arch_prefix)TARGET_LIBATOMIC := $(shell $($(combo_2nd_arch_prefix)TARGET_CC) \
$($(combo_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS) -print-file-name=libatomic.a)
-target_libgcov := $(shell $($(combo_2nd_arch_prefix)TARGET_CC) $($(combo_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS) \
- -print-file-name=libgcov.a)
endif
-# Define FDO (Feedback Directed Optimization) options.
-
-$(combo_2nd_arch_prefix)TARGET_FDO_CFLAGS:=
-$(combo_2nd_arch_prefix)TARGET_FDO_LIB:=
-
-ifneq ($(strip $(BUILD_FDO_INSTRUMENT)),)
- # Set BUILD_FDO_INSTRUMENT=true to turn on FDO instrumentation.
- # The profile will be generated on /data/local/tmp/profile on the device.
- $(combo_2nd_arch_prefix)TARGET_FDO_CFLAGS := -fprofile-generate=/data/local/tmp/profile -DANDROID_FDO
- $(combo_2nd_arch_prefix)TARGET_FDO_LIB := $(target_libgcov)
-else
- # If BUILD_FDO_INSTRUMENT is turned off, then consider doing the FDO optimizations.
- # Set TARGET_FDO_PROFILE_PATH to set a custom profile directory for your build.
- ifeq ($(strip $($(combo_2nd_arch_prefix)TARGET_FDO_PROFILE_PATH)),)
- $(combo_2nd_arch_prefix)TARGET_FDO_PROFILE_PATH := fdo/profiles/$(TARGET_$(combo_2nd_arch_prefix)ARCH)/$(TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT)
- else
- ifeq ($(strip $(wildcard $($(combo_2nd_arch_prefix)TARGET_FDO_PROFILE_PATH))),)
- $(warning Custom $(combo_2nd_arch_prefix)TARGET_FDO_PROFILE_PATH supplied, but directory does not exist. Turn off FDO.)
- endif
- endif
-
- # If the FDO profile directory can't be found, then FDO is off.
- ifneq ($(strip $(wildcard $($(combo_2nd_arch_prefix)TARGET_FDO_PROFILE_PATH))),)
- $(combo_2nd_arch_prefix)TARGET_FDO_CFLAGS := -fprofile-use=$($(combo_2nd_arch_prefix)TARGET_FDO_PROFILE_PATH) -DANDROID_FDO
- $(combo_2nd_arch_prefix)TARGET_FDO_LIB := $(target_libgcov)
- endif
-endif
-
-
KERNEL_HEADERS_COMMON := $(libc_root)/kernel/uapi
KERNEL_HEADERS_ARCH := $(libc_root)/kernel/uapi/asm-$(TARGET_$(combo_2nd_arch_prefix)ARCH)
KERNEL_HEADERS := $(KERNEL_HEADERS_COMMON) $(KERNEL_HEADERS_ARCH)
@@ -237,7 +207,6 @@
$(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
$(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--end-group) \
$(if $(TARGET_BUILD_APPS),$(PRIVATE_TARGET_LIBGCC)) \
- $(PRIVATE_TARGET_FDO_LIB) \
$(call normalize-target-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \
-o $@ \
$(PRIVATE_TARGET_GLOBAL_LDFLAGS) \
@@ -264,7 +233,6 @@
$(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
$(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--end-group) \
$(if $(TARGET_BUILD_APPS),$(PRIVATE_TARGET_LIBGCC)) \
- $(PRIVATE_TARGET_FDO_LIB) \
$(call normalize-target-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \
-o $@ \
$(PRIVATE_TARGET_GLOBAL_LDFLAGS) \
@@ -291,7 +259,6 @@
-Wl,--start-group \
$(call normalize-target-libraries,$(filter %libc.a,$(PRIVATE_ALL_STATIC_LIBRARIES))) \
$(call normalize-target-libraries,$(filter %libc_nomalloc.a,$(PRIVATE_ALL_STATIC_LIBRARIES))) \
- $(PRIVATE_TARGET_FDO_LIB) \
$(PRIVATE_TARGET_LIBATOMIC) \
$(if $(PRIVATE_LIBCXX),,$(PRIVATE_TARGET_LIBGCC)) \
-Wl,--end-group \
diff --git a/core/combo/TARGET_linux-arm64.mk b/core/combo/TARGET_linux-arm64.mk
index 02c4b99..e04329e 100644
--- a/core/combo/TARGET_linux-arm64.mk
+++ b/core/combo/TARGET_linux-arm64.mk
@@ -35,7 +35,7 @@
endif
# Decouple NDK library selection with platform compiler version
-TARGET_NDK_GCC_VERSION := 4.8
+TARGET_NDK_GCC_VERSION := 4.9
ifeq ($(strip $(TARGET_GCC_VERSION_EXP)),)
TARGET_GCC_VERSION := 4.9
@@ -49,6 +49,7 @@
endif
include $(TARGET_ARCH_SPECIFIC_MAKEFILE)
+include $(BUILD_SYSTEM)/combo/fdo.mk
# You can set TARGET_TOOLS_PREFIX to get gcc from somewhere else
ifeq ($(strip $(TARGET_TOOLS_PREFIX)),)
@@ -173,7 +174,6 @@
$(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
$(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--end-group) \
$(if $(TARGET_BUILD_APPS),$(PRIVATE_TARGET_LIBGCC)) \
- $(PRIVATE_TARGET_FDO_LIB) \
$(call normalize-target-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \
-o $@ \
$(PRIVATE_TARGET_GLOBAL_LDFLAGS) \
@@ -200,7 +200,6 @@
$(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
$(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--end-group) \
$(if $(TARGET_BUILD_APPS),$(PRIVATE_TARGET_LIBGCC)) \
- $(PRIVATE_TARGET_FDO_LIB) \
$(call normalize-target-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \
-o $@ \
$(PRIVATE_TARGET_GLOBAL_LDFLAGS) \
@@ -227,7 +226,6 @@
-Wl,--start-group \
$(call normalize-target-libraries,$(filter %libc.a,$(PRIVATE_ALL_STATIC_LIBRARIES))) \
$(call normalize-target-libraries,$(filter %libc_nomalloc.a,$(PRIVATE_ALL_STATIC_LIBRARIES))) \
- $(PRIVATE_TARGET_FDO_LIB) \
$(PRIVATE_TARGET_LIBATOMIC) \
$(if $(PRIVATE_LIBCXX),,$(PRIVATE_TARGET_LIBGCC)) \
-Wl,--end-group \
diff --git a/core/combo/TARGET_linux-mips.mk b/core/combo/TARGET_linux-mips.mk
index d702cc5..7a1f6c5 100644
--- a/core/combo/TARGET_linux-mips.mk
+++ b/core/combo/TARGET_linux-mips.mk
@@ -49,6 +49,7 @@
endif
include $(TARGET_ARCH_SPECIFIC_MAKEFILE)
+include $(BUILD_SYSTEM)/combo/fdo.mk
# You can set TARGET_TOOLS_PREFIX to get gcc from somewhere else
ifeq ($(strip $($(combo_2nd_arch_prefix)TARGET_TOOLS_PREFIX)),)
@@ -155,39 +156,8 @@
ifneq ($(LIBGCC_EH),libgcc_eh.a)
$(combo_2nd_arch_prefix)TARGET_LIBGCC += $(LIBGCC_EH)
endif
-target_libgcov := $(shell $($(combo_2nd_arch_prefix)TARGET_CC) $($(combo_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS) \
- --print-file-name=libgcov.a)
endif
-# Define FDO (Feedback Directed Optimization) options.
-
-$(combo_2nd_arch_prefix)TARGET_FDO_CFLAGS:=
-$(combo_2nd_arch_prefix)TARGET_FDO_LIB:=
-
-ifneq ($(strip $(BUILD_FDO_INSTRUMENT)),)
- # Set BUILD_FDO_INSTRUMENT=true to turn on FDO instrumentation.
- # The profile will be generated on /data/local/tmp/profile on the device.
- $(combo_2nd_arch_prefix)TARGET_FDO_CFLAGS := -fprofile-generate=/data/local/tmp/profile -DANDROID_FDO
- $(combo_2nd_arch_prefix)TARGET_FDO_LIB := $(target_libgcov)
-else
- # If BUILD_FDO_INSTRUMENT is turned off, then consider doing the FDO optimizations.
- # Set TARGET_FDO_PROFILE_PATH to set a custom profile directory for your build.
- ifeq ($(strip $($(combo_2nd_arch_prefix)TARGET_FDO_PROFILE_PATH)),)
- $(combo_2nd_arch_prefix)TARGET_FDO_PROFILE_PATH := fdo/profiles/$(TARGET_$(combo_2nd_arch_prefix)ARCH)/$(TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT)
- else
- ifeq ($(strip $(wildcard $($(combo_2nd_arch_prefix)TARGET_FDO_PROFILE_PATH))),)
- $(warning Custom $(combo_2nd_arch_prefix)TARGET_FDO_PROFILE_PATH supplied, but directory does not exist. Turn off FDO.)
- endif
- endif
-
- # If the FDO profile directory can't be found, then FDO is off.
- ifneq ($(strip $(wildcard $($(combo_2nd_arch_prefix)TARGET_FDO_PROFILE_PATH))),)
- $(combo_2nd_arch_prefix)TARGET_FDO_CFLAGS := -fprofile-use=$($(combo_2nd_arch_prefix)TARGET_FDO_PROFILE_PATH) -DANDROID_FDO
- $(combo_2nd_arch_prefix)TARGET_FDO_LIB := $(target_libgcov)
- endif
-endif
-
-
KERNEL_HEADERS_COMMON := $(libc_root)/kernel/uapi
KERNEL_HEADERS_ARCH := $(libc_root)/kernel/uapi/asm-mips # mips covers both mips and mips64.
KERNEL_HEADERS := $(KERNEL_HEADERS_COMMON) $(KERNEL_HEADERS_ARCH)
@@ -228,7 +198,6 @@
$(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
$(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--end-group) \
$(if $(TARGET_BUILD_APPS),$(PRIVATE_TARGET_LIBGCC)) \
- $(PRIVATE_TARGET_FDO_LIB) \
$(call normalize-target-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \
-o $@ \
$(PRIVATE_TARGET_GLOBAL_LDFLAGS) \
@@ -255,7 +224,6 @@
$(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
$(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--end-group) \
$(if $(TARGET_BUILD_APPS),$(PRIVATE_TARGET_LIBGCC)) \
- $(PRIVATE_TARGET_FDO_LIB) \
$(call normalize-target-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \
-o $@ \
$(PRIVATE_TARGET_GLOBAL_LDFLAGS) \
@@ -282,7 +250,6 @@
-Wl,--start-group \
$(call normalize-target-libraries,$(filter %libc.a,$(PRIVATE_ALL_STATIC_LIBRARIES))) \
$(call normalize-target-libraries,$(filter %libc_nomalloc.a,$(PRIVATE_ALL_STATIC_LIBRARIES))) \
- $(PRIVATE_TARGET_FDO_LIB) \
$(PRIVATE_TARGET_LIBATOMIC) \
$(if $(PRIVATE_LIBCXX),,$(PRIVATE_TARGET_LIBGCC)) \
-Wl,--end-group \
diff --git a/core/combo/TARGET_linux-mips64.mk b/core/combo/TARGET_linux-mips64.mk
index aa456ef..5c359de 100644
--- a/core/combo/TARGET_linux-mips64.mk
+++ b/core/combo/TARGET_linux-mips64.mk
@@ -52,6 +52,7 @@
WITHOUT_TARGET_CLANG := true
include $(TARGET_ARCH_SPECIFIC_MAKEFILE)
+include $(BUILD_SYSTEM)/combo/fdo.mk
# You can set TARGET_TOOLS_PREFIX to get gcc from somewhere else
ifeq ($(strip $(TARGET_TOOLS_PREFIX)),)
@@ -159,39 +160,8 @@
ifneq ($(LIBGCC_EH),libgcc_eh.a)
TARGET_LIBGCC += $(LIBGCC_EH)
endif
-target_libgcov := $(shell $(TARGET_CC) $(TARGET_GLOBAL_CFLAGS) \
- --print-file-name=libgcov.a)
endif
-# Define FDO (Feedback Directed Optimization) options.
-
-TARGET_FDO_CFLAGS:=
-TARGET_FDO_LIB:=
-
-ifneq ($(strip $(BUILD_FDO_INSTRUMENT)),)
- # Set BUILD_FDO_INSTRUMENT=true to turn on FDO instrumentation.
- # The profile will be generated on /data/local/tmp/profile on the device.
- TARGET_FDO_CFLAGS := -fprofile-generate=/data/local/tmp/profile -DANDROID_FDO
- TARGET_FDO_LIB := $(target_libgcov)
-else
- # If BUILD_FDO_INSTRUMENT is turned off, then consider doing the FDO optimizations.
- # Set TARGET_FDO_PROFILE_PATH to set a custom profile directory for your build.
- ifeq ($(strip $(TARGET_FDO_PROFILE_PATH)),)
- TARGET_FDO_PROFILE_PATH := fdo/profiles/$(TARGET_ARCH)/$(TARGET_ARCH_VARIANT)
- else
- ifeq ($(strip $(wildcard $(TARGET_FDO_PROFILE_PATH))),)
- $(warning Custom TARGET_FDO_PROFILE_PATH supplied, but directory does not exist. Turn off FDO.)
- endif
- endif
-
- # If the FDO profile directory can't be found, then FDO is off.
- ifneq ($(strip $(wildcard $(TARGET_FDO_PROFILE_PATH))),)
- TARGET_FDO_CFLAGS := -fprofile-use=$(TARGET_FDO_PROFILE_PATH) -DANDROID_FDO
- TARGET_FDO_LIB := $(target_libgcov)
- endif
-endif
-
-
KERNEL_HEADERS_COMMON := $(libc_root)/kernel/uapi
KERNEL_HEADERS_ARCH := $(libc_root)/kernel/uapi/asm-mips
# TODO: perhaps use $(libc_root)/kernel/uapi/asm-$(TARGET_ARCH) instead of asm-mips ?
@@ -235,7 +205,6 @@
$(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
$(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--end-group) \
$(if $(TARGET_BUILD_APPS),$(PRIVATE_TARGET_LIBGCC)) \
- $(PRIVATE_TARGET_FDO_LIB) \
$(call normalize-target-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \
-o $@ \
$(PRIVATE_TARGET_GLOBAL_LDFLAGS) \
@@ -262,7 +231,6 @@
$(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
$(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--end-group) \
$(if $(TARGET_BUILD_APPS),$(PRIVATE_TARGET_LIBGCC)) \
- $(PRIVATE_TARGET_FDO_LIB) \
$(call normalize-target-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \
-o $@ \
$(PRIVATE_TARGET_GLOBAL_LDFLAGS) \
@@ -289,7 +257,6 @@
-Wl,--start-group \
$(call normalize-target-libraries,$(filter %libc.a,$(PRIVATE_ALL_STATIC_LIBRARIES))) \
$(call normalize-target-libraries,$(filter %libc_nomalloc.a,$(PRIVATE_ALL_STATIC_LIBRARIES))) \
- $(PRIVATE_TARGET_FDO_LIB) \
$(PRIVATE_TARGET_LIBATOMIC) \
$(if $(PRIVATE_LIBCXX),,$(PRIVATE_TARGET_LIBGCC)) \
-Wl,--end-group \
diff --git a/core/combo/TARGET_linux-x86.mk b/core/combo/TARGET_linux-x86.mk
index 2ca99ef..3956603 100644
--- a/core/combo/TARGET_linux-x86.mk
+++ b/core/combo/TARGET_linux-x86.mk
@@ -41,7 +41,7 @@
endif
include $(TARGET_ARCH_SPECIFIC_MAKEFILE)
-
+include $(BUILD_SYSTEM)/combo/fdo.mk
# You can set TARGET_TOOLS_PREFIX to get gcc from somewhere else
ifeq ($(strip $($(combo_2nd_arch_prefix)TARGET_TOOLS_PREFIX)),)
@@ -62,8 +62,6 @@
$(shell $($(combo_2nd_arch_prefix)TARGET_CC) -m32 -print-file-name=libgcc.a)
$(combo_2nd_arch_prefix)TARGET_LIBATOMIC := \
$(shell $($(combo_2nd_arch_prefix)TARGET_CC) -m32 -print-file-name=libatomic.a)
-target_libgcov := $(shell $($(combo_2nd_arch_prefix)TARGET_CC) $($(combo_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS) \
- -print-file-name=libgcov.a)
endif
$(combo_2nd_arch_prefix)TARGET_NO_UNDEFINED_LDFLAGS := -Wl,--no-undefined
@@ -72,34 +70,6 @@
libm_root := bionic/libm
libstdc++_root := bionic/libstdc++
-# Define FDO (Feedback Directed Optimization) options.
-
-$(combo_2nd_arch_prefix)TARGET_FDO_CFLAGS:=
-$(combo_2nd_arch_prefix)TARGET_FDO_LIB:=
-
-ifneq ($(strip $(BUILD_FDO_INSTRUMENT)),)
- # Set BUILD_FDO_INSTRUMENT=true to turn on FDO instrumentation.
- # The profile will be generated on /data/local/tmp/profile on the device.
- $(combo_2nd_arch_prefix)TARGET_FDO_CFLAGS := -fprofile-generate=/data/local/tmp/profile -DANDROID_FDO
- $(combo_2nd_arch_prefix)TARGET_FDO_LIB := $(target_libgcov)
-else
- # If BUILD_FDO_INSTRUMENT is turned off, then consider doing the FDO optimizations.
- # Set TARGET_FDO_PROFILE_PATH to set a custom profile directory for your build.
- ifeq ($(strip $($(combo_2nd_arch_prefix)TARGET_FDO_PROFILE_PATH)),)
- $(combo_2nd_arch_prefix)TARGET_FDO_PROFILE_PATH := fdo/profiles/$(TARGET_$(combo_2nd_arch_prefix)ARCH)/$(TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT)
- else
- ifeq ($(strip $(wildcard $($(combo_2nd_arch_prefix)TARGET_FDO_PROFILE_PATH))),)
- $(warning Custom $(combo_2nd_arch_prefix)TARGET_FDO_PROFILE_PATH supplied, but directory does not exist. Turn off FDO.)
- endif
- endif
-
- # If the FDO profile directory can't be found, then FDO is off.
- ifneq ($(strip $(wildcard $($(combo_2nd_arch_prefix)TARGET_FDO_PROFILE_PATH))),)
- $(combo_2nd_arch_prefix)TARGET_FDO_CFLAGS := -fprofile-use=$($(combo_2nd_arch_prefix)TARGET_FDO_PROFILE_PATH) -DANDROID_FDO
- $(combo_2nd_arch_prefix)TARGET_FDO_LIB := $(target_libgcov)
- endif
-endif
-
KERNEL_HEADERS_COMMON := $(libc_root)/kernel/uapi
KERNEL_HEADERS_ARCH := $(libc_root)/kernel/uapi/asm-x86 # x86 covers both x86 and x86_64.
KERNEL_HEADERS := $(KERNEL_HEADERS_COMMON) $(KERNEL_HEADERS_ARCH)
@@ -193,7 +163,6 @@
$(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
$(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--end-group) \
$(if $(TARGET_BUILD_APPS),$(PRIVATE_TARGET_LIBGCC)) \
- $(PRIVATE_TARGET_FDO_LIB) \
$(call normalize-target-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \
-o $@ \
$(PRIVATE_LDFLAGS) \
@@ -220,7 +189,6 @@
$(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
$(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--end-group) \
$(if $(TARGET_BUILD_APPS),$(PRIVATE_TARGET_LIBGCC)) \
- $(PRIVATE_TARGET_FDO_LIB) \
$(call normalize-target-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \
-o $@ \
$(PRIVATE_LDFLAGS) \
@@ -244,7 +212,6 @@
-Wl,--no-whole-archive \
-Wl,--start-group \
$(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
- $(PRIVATE_TARGET_FDO_LIB) \
$(PRIVATE_TARGET_LIBATOMIC) \
$(if $(PRIVATE_LIBCXX),,$(PRIVATE_TARGET_LIBGCC)) \
-Wl,--end-group \
diff --git a/core/combo/TARGET_linux-x86_64.mk b/core/combo/TARGET_linux-x86_64.mk
index 9dbcc19..4f727a2 100644
--- a/core/combo/TARGET_linux-x86_64.mk
+++ b/core/combo/TARGET_linux-x86_64.mk
@@ -41,7 +41,7 @@
endif
include $(TARGET_ARCH_SPECIFIC_MAKEFILE)
-
+include $(BUILD_SYSTEM)/combo/fdo.mk
# You can set TARGET_TOOLS_PREFIX to get gcc from somewhere else
ifeq ($(strip $(TARGET_TOOLS_PREFIX)),)
@@ -62,8 +62,6 @@
$(shell $(TARGET_CC) -m64 -print-file-name=libgcc.a)
TARGET_LIBATOMIC := \
$(shell $(TARGET_CC) -m64 -print-file-name=libatomic.a)
-target_libgcov := $(shell $(TARGET_CC) $(TARGET_GLOBAL_CFLAGS) \
- -print-file-name=libgcov.a)
endif
TARGET_NO_UNDEFINED_LDFLAGS := -Wl,--no-undefined
@@ -72,34 +70,6 @@
libm_root := bionic/libm
libstdc++_root := bionic/libstdc++
-# Define FDO (Feedback Directed Optimization) options.
-
-TARGET_FDO_CFLAGS:=
-TARGET_FDO_LIB:=
-
-ifneq ($(strip $(BUILD_FDO_INSTRUMENT)),)
- # Set BUILD_FDO_INSTRUMENT=true to turn on FDO instrumentation.
- # The profile will be generated on /data/local/tmp/profile on the device.
- TARGET_FDO_CFLAGS := -fprofile-generate=/data/local/tmp/profile -DANDROID_FDO
- TARGET_FDO_LIB := $(target_libgcov)
-else
- # If BUILD_FDO_INSTRUMENT is turned off, then consider doing the FDO optimizations.
- # Set TARGET_FDO_PROFILE_PATH to set a custom profile directory for your build.
- ifeq ($(strip $(TARGET_FDO_PROFILE_PATH)),)
- TARGET_FDO_PROFILE_PATH := fdo/profiles/$(TARGET_ARCH)/$(TARGET_ARCH_VARIANT)
- else
- ifeq ($(strip $(wildcard $(TARGET_FDO_PROFILE_PATH))),)
- $(warning Custom TARGET_FDO_PROFILE_PATH supplied, but directory does not exist. Turn off FDO.)
- endif
- endif
-
- # If the FDO profile directory can't be found, then FDO is off.
- ifneq ($(strip $(wildcard $(TARGET_FDO_PROFILE_PATH))),)
- TARGET_FDO_CFLAGS := -fprofile-use=$(TARGET_FDO_PROFILE_PATH) -DANDROID_FDO
- TARGET_FDO_LIB := $(target_libgcov)
- endif
-endif
-
KERNEL_HEADERS_COMMON := $(libc_root)/kernel/uapi
KERNEL_HEADERS_ARCH := $(libc_root)/kernel/uapi/asm-x86 # x86 covers both x86 and x86_64.
KERNEL_HEADERS := $(KERNEL_HEADERS_COMMON) $(KERNEL_HEADERS_ARCH)
@@ -197,7 +167,6 @@
$(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
$(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--end-group) \
$(if $(TARGET_BUILD_APPS),$(PRIVATE_TARGET_LIBGCC)) \
- $(PRIVATE_TARGET_FDO_LIB) \
$(call normalize-target-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \
-o $@ \
$(PRIVATE_LDFLAGS) \
@@ -223,7 +192,6 @@
$(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
$(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--end-group) \
$(if $(TARGET_BUILD_APPS),$(PRIVATE_TARGET_LIBGCC)) \
- $(PRIVATE_TARGET_FDO_LIB) \
$(call normalize-target-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \
-o $@ \
$(PRIVATE_LDFLAGS) \
@@ -247,7 +215,6 @@
-Wl,--no-whole-archive \
-Wl,--start-group \
$(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
- $(PRIVATE_TARGET_FDO_LIB) \
$(PRIVATE_TARGET_LIBATOMIC) \
$(if $(PRIVATE_LIBCXX),,$(PRIVATE_TARGET_LIBGCC)) \
-Wl,--end-group \
diff --git a/core/combo/fdo.mk b/core/combo/fdo.mk
new file mode 100644
index 0000000..93d9a9c
--- /dev/null
+++ b/core/combo/fdo.mk
@@ -0,0 +1,38 @@
+#
+# Copyright (C) 2006 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# Setup FDO related flags.
+
+$(combo_2nd_arch_prefix)TARGET_FDO_CFLAGS:=
+
+ifeq ($(strip $(BUILD_FDO_INSTRUMENT)), true)
+ # Set BUILD_FDO_INSTRUMENT=true to turn on FDO instrumentation.
+ # The profile will be generated on /sdcard/fdo_profile on the device.
+ $(combo_2nd_arch_prefix)TARGET_FDO_CFLAGS := -fprofile-generate=/sdcard/fdo_profile -DANDROID_FDO
+else
+ ifeq ($(strip $(BUILD_FDO_OPTIMIZE)), true)
+ # Set TARGET_FDO_PROFILE_PATH to set a custom profile directory for your build.
+ ifeq ($(strip $($(combo_2nd_arch_prefix)TARGET_FDO_PROFILE_PATH)),)
+ $(combo_2nd_arch_prefix)TARGET_FDO_PROFILE_PATH := fdo_profiles
+ endif
+
+ ifneq ($(strip $(wildcard $($(combo_2nd_arch_prefix)TARGET_FDO_PROFILE_PATH))),)
+ $(combo_2nd_arch_prefix)TARGET_FDO_CFLAGS := -fprofile-use=$($(combo_2nd_arch_prefix)TARGET_FDO_PROFILE_PATH) -DANDROID_FDO -fprofile-correction -Wcoverage-mismatch -Wno-error
+ else
+ $(warning Profile directory $($(combo_2nd_arch_prefix)TARGET_FDO_PROFILE_PATH) does not exist. Turn off FDO.)
+ endif
+ endif
+endif
diff --git a/core/combo/select.mk b/core/combo/select.mk
index e18cb1b..d495c6f 100644
--- a/core/combo/select.mk
+++ b/core/combo/select.mk
@@ -82,6 +82,10 @@
# on a workstation.
export CCACHE_BASEDIR := /
+ # Workaround for ccache with clang.
+ # See http://petereisentraut.blogspot.com/2011/09/ccache-and-clang-part-2.html
+ export CCACHE_CPP2 := true
+
CCACHE_HOST_TAG := $(HOST_PREBUILT_TAG)
# If we are cross-compiling Windows binaries on Linux
# then use the linux ccache binary instead.
diff --git a/core/config.mk b/core/config.mk
index 0e612a7..716f88f 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -534,7 +534,7 @@
# allow overriding default Java libraries on a per-target basis
ifeq ($(TARGET_DEFAULT_JAVA_LIBRARIES),)
- TARGET_DEFAULT_JAVA_LIBRARIES := core-libart core-junit ext framework framework2
+ TARGET_DEFAULT_JAVA_LIBRARIES := core-libart core-junit ext framework
endif
TARGET_CPU_SMP ?= true
@@ -587,6 +587,9 @@
$(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 := system_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
diff --git a/core/definitions.mk b/core/definitions.mk
index d7c68f3..6656591 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -1689,7 +1689,7 @@
define transform-classes.jar-to-dex
@echo "target Dex: $(PRIVATE_MODULE)"
@mkdir -p $(dir $@)
-$(hide) rm -f $(dir $@)/classes*.dex
+$(hide) rm -f $(dir $@)classes*.dex
$(hide) $(DX) \
$(if $(findstring windows,$(HOST_OS)),,-JXms16M -JXmx2048M) \
--dex --output=$(dir $@) \
@@ -1762,7 +1762,7 @@
#TODO: update the manifest to point to the dex file
define add-dex-to-package
-$(hide) zip -qj $@ $(dir $(PRIVATE_DEX_FILE))/classes*.dex
+$(hide) zip -qj $@ $(dir $(PRIVATE_DEX_FILE))classes*.dex
endef
# Add java resources added by the current module.
diff --git a/core/dex_preopt_libart.mk b/core/dex_preopt_libart.mk
index 8fc0c67..2d9c518 100644
--- a/core/dex_preopt_libart.mk
+++ b/core/dex_preopt_libart.mk
@@ -20,12 +20,7 @@
# start of image reserved address space
LIBART_IMG_HOST_BASE_ADDRESS := 0x60000000
-
-ifeq ($(TARGET_ARCH),mips)
-LIBART_IMG_TARGET_BASE_ADDRESS := 0x30000000
-else
LIBART_IMG_TARGET_BASE_ADDRESS := 0x70000000
-endif
define get-product-default-property
$(strip $(patsubst $(1)=%,%,$(filter $(1)=%,$(PRODUCT_DEFAULT_PROPERTY_OVERRIDES))))
@@ -36,6 +31,17 @@
DEX2OAT_XMS := $(call get-product-default-property,dalvik.vm.dex2oat-Xms)
DEX2OAT_XMX := $(call get-product-default-property,dalvik.vm.dex2oat-Xmx)
+ifeq ($(TARGET_ARCH),mips)
+# MIPS specific overrides.
+# For MIPS the ART image is loaded at a lower address. This causes issues
+# with the image overlapping with memory on the host cross-compiling and
+# building the image. We therefore limit the Xmx value. This isn't done
+# via a property as we want the larger Xmx value if we're running on a
+# MIPS device.
+LIBART_IMG_TARGET_BASE_ADDRESS := 0x30000000
+DEX2OAT_XMX := 128m
+endif
+
########################################################################
# The full system boot classpath
diff --git a/core/droiddoc.mk b/core/droiddoc.mk
index 655af9b..d3e61d5 100644
--- a/core/droiddoc.mk
+++ b/core/droiddoc.mk
@@ -64,12 +64,15 @@
# Use android_stubs_current if LOCAL_SDK_VERSION is current and no TARGET_BUILD_APPS.
LOCAL_JAVA_LIBRARIES := android_stubs_current $(LOCAL_JAVA_LIBRARIES)
$(full_target): PRIVATE_BOOTCLASSPATH := $(call java-lib-files, android_stubs_current)
+ 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
LOCAL_JAVA_LIBRARIES := sdk_v$(LOCAL_SDK_VERSION) $(LOCAL_JAVA_LIBRARIES)
$(full_target): PRIVATE_BOOTCLASSPATH := $(call java-lib-files, sdk_v$(LOCAL_SDK_VERSION))
endif
else
- LOCAL_JAVA_LIBRARIES := core-libart ext framework framework2 $(LOCAL_JAVA_LIBRARIES)
+ LOCAL_JAVA_LIBRARIES := core-libart ext framework $(LOCAL_JAVA_LIBRARIES)
$(full_target): PRIVATE_BOOTCLASSPATH := $(call java-lib-files, core-libart)
endif # LOCAL_SDK_VERSION
LOCAL_JAVA_LIBRARIES := $(sort $(LOCAL_JAVA_LIBRARIES))
diff --git a/core/envsetup.mk b/core/envsetup.mk
index fcbc91f..96044b3 100644
--- a/core/envsetup.mk
+++ b/core/envsetup.mk
@@ -119,12 +119,21 @@
# Define them here so they can be used in product config files.
TARGET_COPY_OUT_SYSTEM := system
TARGET_COPY_OUT_DATA := data
-TARGET_COPY_OUT_VENDOR := system/vendor
TARGET_COPY_OUT_OEM := oem
TARGET_COPY_OUT_ROOT := root
TARGET_COPY_OUT_RECOVERY := recovery
+###########################################
+# Define TARGET_COPY_OUT_VENDOR to a placeholder, for at this point
+# we don't know if the device wants to build a separate vendor.img
+# or just build vendor stuff into system.img.
+# A device can set up TARGET_COPY_OUT_VENDOR to "vendor" in its
+# BoardConfig.mk.
+# We'll substitute with the real value after loading BoardConfig.mk.
+_vendor_path_placeholder := ||VENDOR-PATH-PH||
+TARGET_COPY_OUT_VENDOR := $(_vendor_path_placeholder)
+###########################################
-# Read the product specs so we an get TARGET_DEVICE and other
+# Read the product specs so we can get TARGET_DEVICE and other
# variables that we need in order to locate the output files.
include $(BUILD_SYSTEM)/product_config.mk
@@ -157,6 +166,17 @@
TARGET_DEVICE_DIR := $(patsubst %/,%,$(dir $(board_config_mk)))
board_config_mk :=
+###########################################
+# Now we can substitute with the real value of TARGET_COPY_OUT_VENDOR
+ifeq ($(TARGET_COPY_OUT_VENDOR),$(_vendor_path_placeholder))
+TARGET_COPY_OUT_VENDOR := system/vendor
+else ifeq ($(filter vendor system/vendor,$(TARGET_COPY_OUT_VENDOR)),)
+$(error TARGET_COPY_OUT_VENDOR must be either 'vendor' or 'system/vendor', seeing '$(TARGET_COPY_OUT_VENDOR)'.)
+endif
+PRODUCT_COPY_FILES := $(subst $(_vendor_path_placeholder),$(TARGET_COPY_OUT_VENDOR),$(PRODUCT_COPY_FILES))
+###########################################
+
+
# ---------------------------------------------------------------
# Set up configuration for target machine.
# The following must be set:
diff --git a/core/executable_internal.mk b/core/executable_internal.mk
index 2e380b6..ab4cf0e 100644
--- a/core/executable_internal.mk
+++ b/core/executable_internal.mk
@@ -28,7 +28,6 @@
# Define PRIVATE_ variables from global vars
my_target_global_ld_dirs := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_GLOBAL_LD_DIRS)
-my_target_fdo_lib := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_FDO_LIB)
my_target_libgcc := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_LIBGCC)
my_target_libatomic := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_LIBATOMIC)
my_target_crtbegin_dynamic_o := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_CRTBEGIN_DYNAMIC_O)
@@ -48,7 +47,6 @@
endif
$(linked_module): PRIVATE_TARGET_GLOBAL_LD_DIRS := $(my_target_global_ld_dirs)
$(linked_module): PRIVATE_TARGET_GLOBAL_LDFLAGS := $(my_target_global_ldflags)
-$(linked_module): PRIVATE_TARGET_FDO_LIB := $(my_target_fdo_lib)
$(linked_module): PRIVATE_TARGET_LIBGCC := $(my_target_libgcc)
$(linked_module): PRIVATE_TARGET_LIBATOMIC := $(my_target_libatomic)
$(linked_module): PRIVATE_TARGET_CRTBEGIN_DYNAMIC_O := $(my_target_crtbegin_dynamic_o)
diff --git a/core/install_jni_libs_internal.mk b/core/install_jni_libs_internal.mk
index eb90c50..944420b 100644
--- a/core/install_jni_libs_internal.mk
+++ b/core/install_jni_libs_internal.mk
@@ -18,7 +18,7 @@
$(LOCAL_JNI_SHARED_LIBRARIES)))
# App-specific lib path.
-my_app_lib_path := $($(my_2nd_arch_prefix)TARGET_OUT$(partition_tag)_SHARED_LIBRARIES)/$(basename $(my_installed_module_stem))
+my_app_lib_path := $(dir $(LOCAL_INSTALLED_MODULE))lib/$(TARGET_$(my_2nd_arch_prefix)ARCH)
my_extracted_jni_libs :=
ifdef my_embed_jni
@@ -54,16 +54,20 @@
# The jni libaries will be installed to the system.img.
my_jni_filenames := $(notdir $(my_jni_shared_libraries))
# Make sure the JNI libraries get installed
-$(LOCAL_INSTALLED_MODULE) : | $(addprefix $($(my_2nd_arch_prefix)TARGET_OUT$(partition_tag)_SHARED_LIBRARIES)/, $(my_jni_filenames))
+my_shared_library_path := $($(my_2nd_arch_prefix)TARGET_OUT$(partition_tag)_SHARED_LIBRARIES)
+$(LOCAL_INSTALLED_MODULE) : | $(addprefix $(my_shared_library_path)/, $(my_jni_filenames))
# Create symlink in the app specific lib path
ifdef LOCAL_POST_INSTALL_CMD
# Add a shell command separator
LOCAL_POST_INSTALL_CMD += ;
endif
+
+my_symlink_target_dir := $(patsubst $(PRODUCT_OUT)%,%,\
+ $(my_shared_library_path))
LOCAL_POST_INSTALL_CMD += \
mkdir -p $(my_app_lib_path) \
- $(foreach lib, $(my_jni_filenames), ;ln -sf ../$(lib) $(my_app_lib_path)/$(lib))
+ $(foreach lib, $(my_jni_filenames), ;ln -sf $(my_symlink_target_dir)/$(lib) $(my_app_lib_path)/$(lib))
$(LOCAL_INSTALLED_MODULE): PRIVATE_POST_INSTALL_CMD := $(LOCAL_POST_INSTALL_CMD)
# Clear jni_shared_libraries to not embed it into the apk.
diff --git a/core/java.mk b/core/java.mk
index 8afa748..52d31d0 100644
--- a/core/java.mk
+++ b/core/java.mk
@@ -26,6 +26,8 @@
ifeq ($(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS),current)
# Use android_stubs_current if LOCAL_SDK_VERSION is current and no TARGET_BUILD_APPS.
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
LOCAL_JAVA_LIBRARIES := sdk_v$(LOCAL_SDK_VERSION) $(LOCAL_JAVA_LIBRARIES)
endif
@@ -142,7 +144,7 @@
else
ifneq (,$(LOCAL_SDK_VERSION))
# Set target-api for LOCAL_SDK_VERSIONs other than current.
-ifneq (,$(filter-out current, $(LOCAL_SDK_VERSION)))
+ifneq (,$(filter-out current system_current, $(LOCAL_SDK_VERSION)))
renderscript_target_api := $(LOCAL_SDK_VERSION)
endif
endif # LOCAL_SDK_VERSION is set
@@ -158,7 +160,7 @@
renderscript_flags += $(LOCAL_RENDERSCRIPT_FLAGS)
# prepend the RenderScript system include path
-ifneq ($(filter-out current,$(LOCAL_SDK_VERSION))$(if $(TARGET_BUILD_APPS),$(filter current,$(LOCAL_SDK_VERSION))),)
+ifneq ($(filter-out current system_current,$(LOCAL_SDK_VERSION))$(if $(TARGET_BUILD_APPS),$(filter current system_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 \
diff --git a/core/package_internal.mk b/core/package_internal.mk
index 57b7b1f..0d6f9ea 100644
--- a/core/package_internal.mk
+++ b/core/package_internal.mk
@@ -68,6 +68,10 @@
LOCAL_AAPT_FLAGS := $(LOCAL_AAPT_FLAGS) -z
endif
+ifdef LOCAL_PACKAGE_SPLITS
+LOCAL_AAPT_FLAGS += $(addprefix --split ,$(LOCAL_PACKAGE_SPLITS))
+endif
+
ifeq (,$(LOCAL_ASSET_DIR))
LOCAL_ASSET_DIR := $(LOCAL_PATH)/assets
endif
@@ -130,6 +134,7 @@
endif
LOCAL_BUILT_MODULE_STEM := package.apk
+LOCAL_INSTALLED_MODULE_STEM := $(LOCAL_MODULE).apk
LOCAL_PROGUARD_ENABLED:=$(strip $(LOCAL_PROGUARD_ENABLED))
ifndef LOCAL_PROGUARD_ENABLED
@@ -193,7 +198,7 @@
$(LOCAL_INTERMEDIATE_TARGETS): \
PRIVATE_ANDROID_MANIFEST := $(full_android_manifest)
-ifneq (,$(filter-out current, $(LOCAL_SDK_VERSION)))
+ifneq (,$(filter-out current system_current, $(LOCAL_SDK_VERSION)))
$(LOCAL_INTERMEDIATE_TARGETS): \
PRIVATE_DEFAULT_APP_TARGET_SDK := $(LOCAL_SDK_VERSION)
else
@@ -281,7 +286,7 @@
# 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,$(LOCAL_SDK_RES_VERSION))$(if $(TARGET_BUILD_APPS),$(filter current,$(LOCAL_SDK_RES_VERSION))),)
+ifneq ($(filter-out current system_current,$(LOCAL_SDK_RES_VERSION))$(if $(TARGET_BUILD_APPS),$(filter current system_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
@@ -365,8 +370,12 @@
$(LOCAL_BUILT_MODULE): PRIVATE_PRODUCT_AAPT_PREF_CONFIG :=
else
$(LOCAL_BUILT_MODULE): PRIVATE_PRODUCT_AAPT_CONFIG := $(PRODUCT_AAPT_CONFIG)
+ifdef LOCAL_PACKAGE_SPLITS
+ $(LOCAL_BUILT_MODULE): PRIVATE_PRODUCT_AAPT_PREF_CONFIG :=
+else
$(LOCAL_BUILT_MODULE): PRIVATE_PRODUCT_AAPT_PREF_CONFIG := $(PRODUCT_AAPT_PREF_CONFIG)
endif
+endif
$(LOCAL_BUILT_MODULE): $(all_res_assets) $(jni_shared_libraries) $(full_android_manifest)
@echo "target Package: $(PRIVATE_MODULE) ($@)"
$(create-empty-package)
@@ -402,6 +411,42 @@
$(hide) rm $@.input
endif
+###############################
+## APK splits
+ifdef LOCAL_PACKAGE_SPLITS
+# LOCAL_PACKAGE_SPLITS is a list of resource labels.
+built_apk_splits := $(foreach s,$(LOCAL_PACKAGE_SPLITS),$(built_module_path)/package_$(s).apk)
+installed_apk_splits := $(foreach s,$(LOCAL_PACKAGE_SPLITS),$(my_module_path)/$(LOCAL_MODULE)_$(s).apk)
+
+# The splits should have been built in the same command building the base apk.
+# This rule just runs signing and zipalign etc.
+# Note that we explicily check the existence of the split apk and remove the
+# built base apk if the split apk isn't there.
+# That way the build system will rerun the aapt after the user changes the splitting parameters.
+$(built_apk_splits): PRIVATE_PRIVATE_KEY := $(private_key)
+$(built_apk_splits): PRIVATE_CERTIFICATE := $(certificate)
+$(built_apk_splits) : $(built_module_path)/%.apk : $(LOCAL_BUILT_MODULE)
+ $(hide) if [ ! -f $@ ]; then \
+ echo 'No $@ generated, check your apk splitting parameters.' 1>&2; \
+ rm $<; exit 1; \
+ fi
+ $(sign-package)
+ $(align-package)
+
+# Rules to install the splits
+$(installed_apk_splits) : $(my_module_path)/$(LOCAL_MODULE)_%.apk : $(built_module_path)/package_%.apk | $(ACP)
+ @echo "Install: $@"
+ $(copy-file-to-new-target)
+
+# Register the additional built and installed files.
+ALL_MODULES.$(my_register_name).INSTALLED += $(installed_apk_splits)
+ALL_MODULES.$(my_register_name).BUILT_INSTALLED += \
+ $(foreach s,$(LOCAL_PACKAGE_SPLITS),$(built_module_path)/package_$(s).apk:$(my_module_path)/$(LOCAL_MODULE)_$(s).apk)
+
+# Make sure to install the splits when you run "make <module_name>".
+$(my_register_name): $(installed_apk_splits)
+endif # LOCAL_PACKAGE_SPLITS
+
# Save information about this package
PACKAGES.$(LOCAL_PACKAGE_NAME).OVERRIDES := $(strip $(LOCAL_OVERRIDES_PACKAGES))
PACKAGES.$(LOCAL_PACKAGE_NAME).RESOURCE_FILES := $(all_resources)
diff --git a/core/pathmap.mk b/core/pathmap.mk
index a4a60fa..0e10ac1 100644
--- a/core/pathmap.mk
+++ b/core/pathmap.mk
@@ -118,11 +118,11 @@
v17/leanback
#
-# A list of all source roots under frameworks/support.
+# A list of all source roots under frameworks/multidex.
#
FRAMEWORKS_MULTIDEX_SUBDIRS := \
- multidex \
- multidex/instrumentation
+ multidex/library/src \
+ multidex/instrumentation/src
#
# A version of FRAMEWORKS_SUPPORT_SUBDIRS that is expanded to full paths from
@@ -130,12 +130,13 @@
#
FRAMEWORKS_SUPPORT_JAVA_SRC_DIRS := \
$(addprefix frameworks/support/,$(FRAMEWORKS_SUPPORT_SUBDIRS)) \
- $(addprefix frameworks/,$(FRAMEWORKS_MULTIDEX_SUBDIRS))
+ $(addprefix frameworks/,$(FRAMEWORKS_MULTIDEX_SUBDIRS))
#
# A list of support library modules.
#
FRAMEWORKS_SUPPORT_JAVA_LIBRARIES := \
$(foreach dir,$(FRAMEWORKS_SUPPORT_SUBDIRS),android-support-$(subst /,-,$(dir))) \
- $(foreach dir,$(FRAMEWORKS_MULTIDEX_SUBDIRS),android-support-$(subst /,-,$(dir)))
+ android-support-multidex \
+ android-support-multidex-instrumentation
diff --git a/core/pdk_config.mk b/core/pdk_config.mk
index fd63820..838754f 100644
--- a/core/pdk_config.mk
+++ b/core/pdk_config.mk
@@ -57,7 +57,6 @@
target/common/obj/JAVA_LIBRARIES/core-junit_intermediates \
target/common/obj/JAVA_LIBRARIES/ext_intermediates \
target/common/obj/JAVA_LIBRARIES/framework_intermediates \
- target/common/obj/JAVA_LIBRARIES/framework2_intermediates \
target/common/obj/JAVA_LIBRARIES/android.test.runner_intermediates \
target/common/obj/JAVA_LIBRARIES/telephony-common_intermediates \
target/common/obj/JAVA_LIBRARIES/voip-common_intermediates \
diff --git a/core/post_clean.mk b/core/post_clean.mk
index 9f15b6d..f7e654b 100644
--- a/core/post_clean.mk
+++ b/core/post_clean.mk
@@ -72,6 +72,7 @@
$(shell echo 'AIDL_FILES.$(p) := $(ALL_MODULES.$(p).AIDL_FILES)' >> $(current_aidl_config)))\
$(if $(filter-out $(ALL_MODULES.$(p).AIDL_FILES),$(AIDL_FILES.$(p))),\
$(eval intermediates_to_clean += $(ALL_MODULES.$(p).INTERMEDIATE_SOURCE_DIR))))
+intermediates_to_clean := $(strip $(intermediates_to_clean))
ifdef intermediates_to_clean
$(info *** Obsolete aidl-generated files detected, clean intermediate files...)
$(info *** rm -rf $(intermediates_to_clean))
diff --git a/core/prebuilt_internal.mk b/core/prebuilt_internal.mk
index 1ee9f9a..5666cfd 100644
--- a/core/prebuilt_internal.mk
+++ b/core/prebuilt_internal.mk
@@ -54,6 +54,11 @@
endif
endif
+ifeq ($(LOCAL_MODULE_CLASS),APPS)
+LOCAL_BUILT_MODULE_STEM := package.apk
+LOCAL_INSTALLED_MODULE_STEM := $(LOCAL_MODULE).apk
+endif
+
ifeq ($(LOCAL_STRIP_MODULE),true)
ifdef LOCAL_IS_HOST_MODULE
$(error Cannot strip host module LOCAL_PATH=$(LOCAL_PATH))
@@ -182,6 +187,42 @@
$(call dexpreopt-one-file,$<,$@)
endif
+###############################
+## Install split apks.
+ifdef LOCAL_PACKAGE_SPLITS
+# LOCAL_PACKAGE_SPLITS is a list of apks to be installed.
+built_apk_splits := $(addprefix $(built_module_path)/,$(notdir $(LOCAL_PACKAGE_SPLITS)))
+installed_apk_splits := $(addprefix $(my_module_path)/,$(notdir $(LOCAL_PACKAGE_SPLITS)))
+
+# Rules to sign and zipalign the split apks.
+my_src_dir := $(sort $(dir $(LOCAL_PACKAGE_SPLITS)))
+ifneq (1,$(words $(my_src_dir)))
+$(error You must put all the split source apks in the same folder: $(LOCAL_PACKAGE_SPLITS))
+endif
+my_src_dir := $(LOCAL_PATH)/$(my_src_dir)
+
+$(built_apk_splits) : PRIVATE_PRIVATE_KEY := $(LOCAL_CERTIFICATE).pk8
+$(built_apk_splits) : PRIVATE_CERTIFICATE := $(LOCAL_CERTIFICATE).x509.pem
+$(built_apk_splits) : $(built_module_path)/%.apk : $(my_src_dir)/%.apk | $(ACP)
+ $(copy-file-to-new-target)
+ $(sign-package)
+ $(align-package)
+
+# Rules to install the split apks.
+$(installed_apk_splits) : $(my_module_path)/%.apk : $(built_module_path)/%.apk | $(ACP)
+ @echo "Install: $@"
+ $(copy-file-to-new-target)
+
+# Register the additional built and installed files.
+ALL_MODULES.$(my_register_name).INSTALLED += $(installed_apk_splits)
+ALL_MODULES.$(my_register_name).BUILT_INSTALLED += \
+ $(foreach s,$(LOCAL_PACKAGE_SPLITS),$(built_module_path)/$(notdir $(s)):$(my_module_path)/$(notdir $(s)))
+
+# Make sure to install the splits when you run "make <module_name>".
+$(my_register_name): $(installed_apk_splits)
+
+endif # LOCAL_PACKAGE_SPLITS
+
else # LOCAL_MODULE_CLASS != APPS
ifneq ($(LOCAL_PREBUILT_STRIP_COMMENTS),)
$(built_module) : $(my_prebuilt_src_file)
diff --git a/core/shared_library_internal.mk b/core/shared_library_internal.mk
index abef11f..c01be37 100644
--- a/core/shared_library_internal.mk
+++ b/core/shared_library_internal.mk
@@ -40,7 +40,6 @@
# Define PRIVATE_ variables from global vars
my_target_global_ld_dirs := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_GLOBAL_LD_DIRS)
-my_target_fdo_lib := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_FDO_LIB)
my_target_libgcc := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_LIBGCC)
my_target_libatomic := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_LIBATOMIC)
my_target_crtbegin_so_o := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_CRTBEGIN_SO_O)
@@ -58,7 +57,6 @@
endif
$(linked_module): PRIVATE_TARGET_GLOBAL_LD_DIRS := $(my_target_global_ld_dirs)
$(linked_module): PRIVATE_TARGET_GLOBAL_LDFLAGS := $(my_target_global_ldflags)
-$(linked_module): PRIVATE_TARGET_FDO_LIB := $(my_target_fdo_lib)
$(linked_module): PRIVATE_TARGET_LIBGCC := $(my_target_libgcc)
$(linked_module): PRIVATE_TARGET_LIBATOMIC := $(my_target_libatomic)
$(linked_module): PRIVATE_TARGET_CRTBEGIN_SO_O := $(my_target_crtbegin_so_o)
diff --git a/core/static_java_library.mk b/core/static_java_library.mk
index 8e6029d..02078e0 100644
--- a/core/static_java_library.mk
+++ b/core/static_java_library.mk
@@ -78,7 +78,7 @@
framework_res_package_export_deps :=
# Please refer to package.mk
ifneq ($(LOCAL_NO_STANDARD_LIBRARIES),true)
-ifneq ($(filter-out current,$(LOCAL_SDK_RES_VERSION))$(if $(TARGET_BUILD_APPS),$(filter current,$(LOCAL_SDK_RES_VERSION))),)
+ifneq ($(filter-out current system_current,$(LOCAL_SDK_RES_VERSION))$(if $(TARGET_BUILD_APPS),$(filter current system_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)
@@ -98,7 +98,7 @@
$(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, $(LOCAL_SDK_VERSION)))
+ifneq (,$(filter-out current system_current, $(LOCAL_SDK_VERSION)))
$(R_file_stamp): PRIVATE_DEFAULT_APP_TARGET_SDK := $(LOCAL_SDK_VERSION)
else
$(R_file_stamp): PRIVATE_DEFAULT_APP_TARGET_SDK := $(DEFAULT_APP_TARGET_SDK)
diff --git a/core/tasks/cts.mk b/core/tasks/cts.mk
index 58bb235..82094b9 100644
--- a/core/tasks/cts.mk
+++ b/core/tasks/cts.mk
@@ -61,6 +61,7 @@
CTS_TEST_JAR_LIST := \
+ cts-junit \
CtsJdwp
# Depend on the full package paths rather than the phony targets to avoid
diff --git a/envsetup.sh b/envsetup.sh
index 36c6896..29e4c4c 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -1248,9 +1248,7 @@
fi
# issue "am" command to cause the hprof dump
- local sdcard=$(adb ${adbOptions} shell echo -n '$EXTERNAL_STORAGE')
- local devFile=$sdcard/hprof-$targetPid
- #local devFile=/data/local/hprof-$targetPid
+ local devFile=/data/local/tmp/hprof-$targetPid
echo "Poking $targetPid and waiting for data..."
echo "Storing data at $devFile"
adb ${adbOptions} shell am dumpheap $targetPid $devFile
diff --git a/target/product/AndroidProducts.mk b/target/product/AndroidProducts.mk
index bce5bb5..abb4d8c 100644
--- a/target/product/AndroidProducts.mk
+++ b/target/product/AndroidProducts.mk
@@ -61,10 +61,15 @@
$(LOCAL_DIR)/aosp_x86_64.mk \
$(LOCAL_DIR)/full_x86_64.mk \
$(LOCAL_DIR)/vbox_x86.mk \
+ $(LOCAL_DIR)/sdk_phone_armv7.mk \
+ $(LOCAL_DIR)/sdk_phone_x86.mk \
+ $(LOCAL_DIR)/sdk_phone_mips.mk \
+ $(LOCAL_DIR)/sdk_phone_arm64.mk \
+ $(LOCAL_DIR)/sdk_phone_x86_64.mk \
+ $(LOCAL_DIR)/sdk_phone_mips64.mk \
$(LOCAL_DIR)/sdk.mk \
$(LOCAL_DIR)/sdk_x86.mk \
$(LOCAL_DIR)/sdk_mips.mk \
$(LOCAL_DIR)/sdk_arm64.mk \
- $(LOCAL_DIR)/sdk_x86_64.mk \
- $(LOCAL_DIR)/sdk_mips64.mk
+ $(LOCAL_DIR)/sdk_x86_64.mk
endif
diff --git a/target/product/base.mk b/target/product/base.mk
index 981f965..3609d03 100644
--- a/target/product/base.mk
+++ b/target/product/base.mk
@@ -18,6 +18,7 @@
PRODUCT_PACKAGES += \
20-dns.conf \
95-configured \
+ appwidget \
am \
android.policy \
android.test.runner \
@@ -31,7 +32,6 @@
dhcpcd-run-hooks \
dnsmasq \
framework \
- framework2 \
fsck_msdos \
ime \
input \
@@ -48,6 +48,7 @@
libcamera_client \
libcameraservice \
libdl \
+ libdrmclearkeyplugin \
libeffectproxy \
libeffects \
libinput \
diff --git a/target/product/core_base.mk b/target/product/core_base.mk
index f14e53d..6c29482 100644
--- a/target/product/core_base.mk
+++ b/target/product/core_base.mk
@@ -50,6 +50,7 @@
libstagefright_soft_mp3dec \
libstagefright_soft_mpeg4dec \
libstagefright_soft_mpeg4enc \
+ libstagefright_soft_opusdec \
libstagefright_soft_rawdec \
libstagefright_soft_vorbisdec \
libstagefright_soft_vpxdec \
diff --git a/target/product/core_minimal.mk b/target/product/core_minimal.mk
index 80df643..b0e3c5a 100644
--- a/target/product/core_minimal.mk
+++ b/target/product/core_minimal.mk
@@ -84,7 +84,6 @@
bouncycastle \
ext \
framework \
- framework2 \
telephony-common \
voip-common \
ims-common \
diff --git a/target/product/core_tiny.mk b/target/product/core_tiny.mk
index 48abfa5..d6e4dc5 100644
--- a/target/product/core_tiny.mk
+++ b/target/product/core_tiny.mk
@@ -87,7 +87,6 @@
bouncycastle \
ext \
framework \
- framework2 \
telephony-common \
voip-common \
ims-common \
diff --git a/target/product/languages_full.mk b/target/product/languages_full.mk
index 68220b3..6fb68be 100644
--- a/target/product/languages_full.mk
+++ b/target/product/languages_full.mk
@@ -21,4 +21,4 @@
# These are all the locales that have translations and are displayable
# by TextView in this branch.
-PRODUCT_LOCALES := en_US en_IN fr_FR it_IT es_ES et_EE de_DE nl_NL cs_CZ pl_PL ja_JP zh_TW zh_CN zh_HK ru_RU ko_KR nb_NO es_US da_DK el_GR tr_TR pt_PT pt_BR rm_CH sv_SE bg_BG ca_ES en_GB fi_FI hi_IN hr_HR hu_HU in_ID iw_IL lt_LT lv_LV ro_RO sk_SK sl_SI sr_RS uk_UA vi_VN tl_PH ar_EG fa_IR th_TH sw_TZ ms_MY af_ZA zu_ZA am_ET hi_IN en_XA ar_XB fr_CA km_KH lo_LA ne_NP si_LK mn_MN hy_AM az_AZ ka_GE my_MM mr_MH ml_KL is_IS mk_MK ky_KG eu_PV gl_GA bn_WB ta_IN kn_KA te_AP uz_UZ ur_PK kk_KZ
+PRODUCT_LOCALES := en_US en_IN fr_FR it_IT es_ES et_EE de_DE nl_NL cs_CZ pl_PL ja_JP zh_TW zh_CN zh_HK ru_RU ko_KR nb_NO es_US da_DK el_GR tr_TR pt_PT pt_BR rm_CH sv_SE bg_BG ca_ES en_GB fi_FI hi_IN hr_HR hu_HU in_ID iw_IL lt_LT lv_LV ro_RO sk_SK sl_SI sr_RS uk_UA vi_VN tl_PH ar_EG fa_IR th_TH sw_TZ ms_MY af_ZA zu_ZA am_ET hi_IN en_XA ar_XB fr_CA km_KH lo_LA ne_NP si_LK mn_MN hy_AM az_AZ ka_GE my_MM mr_IN ml_IN is_IS mk_MK ky_KG eu_ES gl_ES bn_BD ta_IN kn_IN te_IN uz_UZ ur_PK kk_KZ
diff --git a/target/product/sdk.mk b/target/product/sdk.mk
index d4f2355..96d8cc9 100644
--- a/target/product/sdk.mk
+++ b/target/product/sdk.mk
@@ -1,5 +1,5 @@
#
-# Copyright (C) 2007 The Android Open Source Project
+# Copyright (C) 2014 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -14,154 +14,8 @@
# limitations under the License.
#
-PRODUCT_PROPERTY_OVERRIDES :=
+# Don't modify this file - It's just an alias!
-PRODUCT_PACKAGES := \
- ApiDemos \
- CubeLiveWallpapers \
- CustomLocale \
- Development \
- DevelopmentSettings \
- Dialer \
- EmulatorSmokeTests \
- Fallback \
- Gallery \
- GestureBuilder \
- LegacyCamera \
- librs_jni \
- libwnndict \
- libWnnEngDic \
- libWnnJpnDic \
- LiveWallpapersPicker \
- Mms \
- Music \
- OpenWnn \
- PinyinIME \
- Protips \
- rild \
- SdkSetup \
- SmokeTest \
- SmokeTestApp \
- SoftKeyboard \
- sqlite3 \
- SystemUI \
- WidgetPreview
+$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk_phone_armv7.mk)
-# Define the host tools and libs that are parts of the SDK.
--include sdk/build/product_sdk.mk
--include development/build/product_sdk.mk
-
-# audio libraries.
-PRODUCT_PACKAGES += \
- audio.primary.goldfish \
- audio_policy.default \
- local_time.default
-
-PRODUCT_PACKAGE_OVERLAYS := development/sdk_overlay
-
-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/native/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 \
- frameworks/av/media/libstagefright/data/media_codecs_google_telephony.xml:system/etc/media_codecs_google_telephony.xml \
- frameworks/av/media/libstagefright/data/media_codecs_google_video.xml:system/etc/media_codecs_google_video.xml \
- device/generic/goldfish/camera/media_codecs.xml:system/etc/media_codecs.xml \
- frameworks/native/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml:system/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml \
- frameworks/native/data/etc/android.hardware.camera.autofocus.xml:system/etc/permissions/android.hardware.camera.autofocus.xml \
- frameworks/av/media/libeffects/data/audio_effects.conf:system/etc/audio_effects.conf \
- hardware/libhardware_legacy/audio/audio_policy.conf:system/etc/audio_policy.conf
-
-include $(SRC_TARGET_DIR)/product/emulator.mk
-
-$(call inherit-product-if-exists, frameworks/base/data/sounds/AllAudio.mk)
-$(call inherit-product-if-exists, frameworks/base/data/fonts/fonts.mk)
-$(call inherit-product-if-exists, external/google-fonts/dancing-script/fonts.mk)
-$(call inherit-product-if-exists, external/google-fonts/carrois-gothic-sc/fonts.mk)
-$(call inherit-product-if-exists, external/google-fonts/coming-soon/fonts.mk)
-$(call inherit-product-if-exists, external/noto-fonts/fonts.mk)
-$(call inherit-product-if-exists, external/naver-fonts/fonts.mk)
-$(call inherit-product-if-exists, frameworks/base/data/keyboards/keyboards.mk)
-$(call inherit-product-if-exists, frameworks/webview/chromium/chromium.mk)
-$(call inherit-product, $(SRC_TARGET_DIR)/product/core.mk)
-
-# include available languages for TTS in the system image
--include external/svox/pico/lang/PicoLangDeDeInSystem.mk
--include external/svox/pico/lang/PicoLangEnGBInSystem.mk
--include external/svox/pico/lang/PicoLangEnUsInSystem.mk
--include external/svox/pico/lang/PicoLangEsEsInSystem.mk
--include external/svox/pico/lang/PicoLangFrFrInSystem.mk
--include external/svox/pico/lang/PicoLangItItInSystem.mk
-
-# locale + densities. en_US is both first and in alphabetical order to
-# ensure this is the default locale.
-PRODUCT_LOCALES := \
- en_US \
- ldpi \
- hdpi \
- mdpi \
- xhdpi \
- ar_EG \
- ar_IL \
- bg_BG \
- ca_ES \
- cs_CZ \
- da_DK \
- de_AT \
- de_CH \
- de_DE \
- de_LI \
- el_GR \
- en_AU \
- en_CA \
- en_GB \
- en_IE \
- en_IN \
- en_NZ \
- en_SG \
- en_US \
- en_ZA \
- es_ES \
- es_US \
- fi_FI \
- fr_BE \
- fr_CA \
- fr_CH \
- fr_FR \
- he_IL \
- hi_IN \
- hr_HR \
- hu_HU \
- id_ID \
- it_CH \
- it_IT \
- ja_JP \
- ko_KR \
- lt_LT \
- lv_LV \
- nb_NO \
- nl_BE \
- nl_NL \
- pl_PL \
- pt_BR \
- pt_PT \
- ro_RO \
- ru_RU \
- sk_SK \
- sl_SI \
- sr_RS \
- sv_SE \
- th_TH \
- tl_PH \
- tr_TR \
- uk_UA \
- vi_VN \
- zh_CN \
- zh_TW
-
-# Overrides
-PRODUCT_BRAND := generic
PRODUCT_NAME := sdk
-PRODUCT_DEVICE := generic
diff --git a/target/product/sdk_arm64.mk b/target/product/sdk_arm64.mk
index 9aa58b3..8bb38f4 100644
--- a/target/product/sdk_arm64.mk
+++ b/target/product/sdk_arm64.mk
@@ -1,5 +1,5 @@
#
-# Copyright (C) 2009 The Android Open Source Project
+# Copyright (C) 2014 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -14,16 +14,8 @@
# limitations under the License.
#
-# This is a build configuration for a full-featured build of the
-# Open-Source part of the tree. It's geared toward a US-centric
-# build quite specifically for the emulator, and might not be
-# entirely appropriate to inherit from for on-device configurations.
+# Don't modify this file - It's just an alias!
-$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
-$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk_phone_arm64.mk)
-# Overrides
-PRODUCT_BRAND := generic_arm64
PRODUCT_NAME := sdk_arm64
-PRODUCT_DEVICE := generic_arm64
-PRODUCT_MODEL := Android SDK built for arm64
diff --git a/target/product/sdk_base.mk b/target/product/sdk_base.mk
new file mode 100644
index 0000000..43fd736
--- /dev/null
+++ b/target/product/sdk_base.mk
@@ -0,0 +1,162 @@
+#
+# Copyright (C) 2007 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+PRODUCT_PROPERTY_OVERRIDES :=
+
+PRODUCT_PACKAGES := \
+ ApiDemos \
+ CubeLiveWallpapers \
+ CustomLocale \
+ Development \
+ DevelopmentSettings \
+ Dialer \
+ EmulatorSmokeTests \
+ Fallback \
+ Gallery \
+ GestureBuilder \
+ LegacyCamera \
+ librs_jni \
+ libwnndict \
+ libWnnEngDic \
+ libWnnJpnDic \
+ LiveWallpapersPicker \
+ Mms \
+ Music \
+ OpenWnn \
+ PinyinIME \
+ Protips \
+ rild \
+ SdkSetup \
+ SmokeTest \
+ SmokeTestApp \
+ SoftKeyboard \
+ sqlite3 \
+ SystemUI \
+ WidgetPreview
+
+# Define the host tools and libs that are parts of the SDK.
+-include sdk/build/product_sdk.mk
+-include development/build/product_sdk.mk
+
+# audio libraries.
+PRODUCT_PACKAGES += \
+ audio.primary.goldfish \
+ audio_policy.default \
+ local_time.default
+
+PRODUCT_PACKAGE_OVERLAYS := development/sdk_overlay
+
+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/native/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 \
+ frameworks/av/media/libstagefright/data/media_codecs_google_telephony.xml:system/etc/media_codecs_google_telephony.xml \
+ frameworks/av/media/libstagefright/data/media_codecs_google_video.xml:system/etc/media_codecs_google_video.xml \
+ device/generic/goldfish/camera/media_codecs.xml:system/etc/media_codecs.xml \
+ frameworks/native/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml:system/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml \
+ frameworks/native/data/etc/android.hardware.camera.autofocus.xml:system/etc/permissions/android.hardware.camera.autofocus.xml \
+ frameworks/av/media/libeffects/data/audio_effects.conf:system/etc/audio_effects.conf \
+ hardware/libhardware_legacy/audio/audio_policy.conf:system/etc/audio_policy.conf
+
+include $(SRC_TARGET_DIR)/product/emulator.mk
+
+$(call inherit-product-if-exists, frameworks/base/data/sounds/AllAudio.mk)
+$(call inherit-product-if-exists, frameworks/base/data/fonts/fonts.mk)
+$(call inherit-product-if-exists, external/google-fonts/dancing-script/fonts.mk)
+$(call inherit-product-if-exists, external/google-fonts/carrois-gothic-sc/fonts.mk)
+$(call inherit-product-if-exists, external/google-fonts/coming-soon/fonts.mk)
+$(call inherit-product-if-exists, external/noto-fonts/fonts.mk)
+$(call inherit-product-if-exists, external/naver-fonts/fonts.mk)
+$(call inherit-product-if-exists, frameworks/base/data/keyboards/keyboards.mk)
+$(call inherit-product-if-exists, frameworks/webview/chromium/chromium.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/core.mk)
+
+# include available languages for TTS in the system image
+-include external/svox/pico/lang/PicoLangDeDeInSystem.mk
+-include external/svox/pico/lang/PicoLangEnGBInSystem.mk
+-include external/svox/pico/lang/PicoLangEnUsInSystem.mk
+-include external/svox/pico/lang/PicoLangEsEsInSystem.mk
+-include external/svox/pico/lang/PicoLangFrFrInSystem.mk
+-include external/svox/pico/lang/PicoLangItItInSystem.mk
+
+# locale + densities. en_US is both first and in alphabetical order to
+# ensure this is the default locale.
+PRODUCT_LOCALES := \
+ en_US \
+ ldpi \
+ hdpi \
+ mdpi \
+ xhdpi \
+ ar_EG \
+ ar_IL \
+ bg_BG \
+ ca_ES \
+ cs_CZ \
+ da_DK \
+ de_AT \
+ de_CH \
+ de_DE \
+ de_LI \
+ el_GR \
+ en_AU \
+ en_CA \
+ en_GB \
+ en_IE \
+ en_IN \
+ en_NZ \
+ en_SG \
+ en_US \
+ en_ZA \
+ es_ES \
+ es_US \
+ fi_FI \
+ fr_BE \
+ fr_CA \
+ fr_CH \
+ fr_FR \
+ he_IL \
+ hi_IN \
+ hr_HR \
+ hu_HU \
+ id_ID \
+ it_CH \
+ it_IT \
+ ja_JP \
+ ko_KR \
+ lt_LT \
+ lv_LV \
+ nb_NO \
+ nl_BE \
+ nl_NL \
+ pl_PL \
+ pt_BR \
+ pt_PT \
+ ro_RO \
+ ru_RU \
+ sk_SK \
+ sl_SI \
+ sr_RS \
+ sv_SE \
+ th_TH \
+ tl_PH \
+ tr_TR \
+ uk_UA \
+ vi_VN \
+ zh_CN \
+ zh_TW
diff --git a/target/product/sdk_mips.mk b/target/product/sdk_mips.mk
index 2072400..366994a 100644
--- a/target/product/sdk_mips.mk
+++ b/target/product/sdk_mips.mk
@@ -1,5 +1,5 @@
#
-# Copyright (C) 2012 The Android Open Source Project
+# Copyright (C) 2014 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -14,15 +14,8 @@
# limitations under the License.
#
-# This is a build configuration for a full-featured build of the
-# Open-Source part of the tree. It's geared toward a US-centric
-# build quite specifically for the emulator, and might not be
-# entirely appropriate to inherit from for on-device configurations.
+# Don't modify this file - It's just an alias!
-$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk_phone_mips.mk)
-# Overrides
-PRODUCT_BRAND := generic_mips
PRODUCT_NAME := sdk_mips
-PRODUCT_DEVICE := generic_mips
-PRODUCT_MODEL := Android SDK for Mips
diff --git a/target/product/sdk_mips64.mk b/target/product/sdk_phone_arm64.mk
similarity index 82%
copy from target/product/sdk_mips64.mk
copy to target/product/sdk_phone_arm64.mk
index c46eaed..c501f14 100644
--- a/target/product/sdk_mips64.mk
+++ b/target/product/sdk_phone_arm64.mk
@@ -20,10 +20,10 @@
# entirely appropriate to inherit from for on-device configurations.
$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
-$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk_base.mk)
# Overrides
-PRODUCT_BRAND := generic_mips64
-PRODUCT_NAME := sdk_mips64
-PRODUCT_DEVICE := generic_mips64
-PRODUCT_MODEL := Android SDK built for mips64
+PRODUCT_BRAND := generic_arm64
+PRODUCT_NAME := sdk_phone_arm64
+PRODUCT_DEVICE := generic_arm64
+PRODUCT_MODEL := Android SDK built for arm64
diff --git a/target/product/sdk_phone_armv7.mk b/target/product/sdk_phone_armv7.mk
new file mode 100644
index 0000000..aeb4940
--- /dev/null
+++ b/target/product/sdk_phone_armv7.mk
@@ -0,0 +1,22 @@
+#
+# Copyright (C) 2007 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk_base.mk)
+
+# Overrides
+PRODUCT_BRAND := generic
+PRODUCT_NAME := sdk_phone_armv7
+PRODUCT_DEVICE := generic
diff --git a/target/product/sdk_mips64.mk b/target/product/sdk_phone_mips.mk
similarity index 72%
copy from target/product/sdk_mips64.mk
copy to target/product/sdk_phone_mips.mk
index c46eaed..818491f 100644
--- a/target/product/sdk_mips64.mk
+++ b/target/product/sdk_phone_mips.mk
@@ -1,5 +1,5 @@
#
-# Copyright (C) 2009 The Android Open Source Project
+# Copyright (C) 2012 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -19,11 +19,10 @@
# build quite specifically for the emulator, and might not be
# entirely appropriate to inherit from for on-device configurations.
-$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
-$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk_base.mk)
# Overrides
-PRODUCT_BRAND := generic_mips64
-PRODUCT_NAME := sdk_mips64
-PRODUCT_DEVICE := generic_mips64
-PRODUCT_MODEL := Android SDK built for mips64
+PRODUCT_BRAND := generic_mips
+PRODUCT_NAME := sdk_phone_mips
+PRODUCT_DEVICE := generic_mips
+PRODUCT_MODEL := Android SDK for Mips
diff --git a/target/product/sdk_mips64.mk b/target/product/sdk_phone_mips64.mk
similarity index 91%
rename from target/product/sdk_mips64.mk
rename to target/product/sdk_phone_mips64.mk
index c46eaed..afdb2a8 100644
--- a/target/product/sdk_mips64.mk
+++ b/target/product/sdk_phone_mips64.mk
@@ -20,10 +20,10 @@
# entirely appropriate to inherit from for on-device configurations.
$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
-$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk_base.mk)
# Overrides
PRODUCT_BRAND := generic_mips64
-PRODUCT_NAME := sdk_mips64
+PRODUCT_NAME := sdk_phone_mips64
PRODUCT_DEVICE := generic_mips64
PRODUCT_MODEL := Android SDK built for mips64
diff --git a/target/product/sdk_mips64.mk b/target/product/sdk_phone_x86.mk
similarity index 76%
copy from target/product/sdk_mips64.mk
copy to target/product/sdk_phone_x86.mk
index c46eaed..95c49ab 100644
--- a/target/product/sdk_mips64.mk
+++ b/target/product/sdk_phone_x86.mk
@@ -19,11 +19,10 @@
# build quite specifically for the emulator, and might not be
# entirely appropriate to inherit from for on-device configurations.
-$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
-$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk_base.mk)
# Overrides
-PRODUCT_BRAND := generic_mips64
-PRODUCT_NAME := sdk_mips64
-PRODUCT_DEVICE := generic_mips64
-PRODUCT_MODEL := Android SDK built for mips64
+PRODUCT_BRAND := generic_x86
+PRODUCT_NAME := sdk_phone_x86
+PRODUCT_DEVICE := generic_x86
+PRODUCT_MODEL := Android SDK built for x86
diff --git a/target/product/sdk_mips64.mk b/target/product/sdk_phone_x86_64.mk
similarity index 81%
copy from target/product/sdk_mips64.mk
copy to target/product/sdk_phone_x86_64.mk
index c46eaed..69e37af 100644
--- a/target/product/sdk_mips64.mk
+++ b/target/product/sdk_phone_x86_64.mk
@@ -20,10 +20,10 @@
# entirely appropriate to inherit from for on-device configurations.
$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
-$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk_base.mk)
# Overrides
-PRODUCT_BRAND := generic_mips64
-PRODUCT_NAME := sdk_mips64
-PRODUCT_DEVICE := generic_mips64
-PRODUCT_MODEL := Android SDK built for mips64
+PRODUCT_BRAND := generic_x86_64
+PRODUCT_NAME := sdk_phone_x86_64
+PRODUCT_DEVICE := generic_x86_64
+PRODUCT_MODEL := Android SDK built for x86_64
diff --git a/target/product/sdk_x86.mk b/target/product/sdk_x86.mk
index 6c5e746..13ee57d 100644
--- a/target/product/sdk_x86.mk
+++ b/target/product/sdk_x86.mk
@@ -1,5 +1,5 @@
#
-# Copyright (C) 2009 The Android Open Source Project
+# Copyright (C) 2014 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -14,15 +14,8 @@
# limitations under the License.
#
-# This is a build configuration for a full-featured build of the
-# Open-Source part of the tree. It's geared toward a US-centric
-# build quite specifically for the emulator, and might not be
-# entirely appropriate to inherit from for on-device configurations.
+# Don't modify this file - It's just an alias!
-$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk_phone_x86.mk)
-# Overrides
-PRODUCT_BRAND := generic_x86
PRODUCT_NAME := sdk_x86
-PRODUCT_DEVICE := generic_x86
-PRODUCT_MODEL := Android SDK built for x86
diff --git a/target/product/sdk_x86_64.mk b/target/product/sdk_x86_64.mk
index 62f2dbb..5f6553e 100644
--- a/target/product/sdk_x86_64.mk
+++ b/target/product/sdk_x86_64.mk
@@ -1,5 +1,5 @@
#
-# Copyright (C) 2009 The Android Open Source Project
+# Copyright (C) 2014 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -14,16 +14,8 @@
# limitations under the License.
#
-# This is a build configuration for a full-featured build of the
-# Open-Source part of the tree. It's geared toward a US-centric
-# build quite specifically for the emulator, and might not be
-# entirely appropriate to inherit from for on-device configurations.
+# Don't modify this file - It's just an alias!
-$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
-$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk_phone_x86_64.mk)
-# Overrides
-PRODUCT_BRAND := generic_x86_64
PRODUCT_NAME := sdk_x86_64
-PRODUCT_DEVICE := generic_x86_64
-PRODUCT_MODEL := Android SDK built for x86_64
diff --git a/tools/releasetools/add_img_to_target_files b/tools/releasetools/add_img_to_target_files
new file mode 120000
index 0000000..04323bd
--- /dev/null
+++ b/tools/releasetools/add_img_to_target_files
@@ -0,0 +1 @@
+add_img_to_target_files.py
\ No newline at end of file
diff --git a/tools/releasetools/add_img_to_target_files.py b/tools/releasetools/add_img_to_target_files.py
new file mode 100755
index 0000000..7be1929
--- /dev/null
+++ b/tools/releasetools/add_img_to_target_files.py
@@ -0,0 +1,284 @@
+#!/usr/bin/env python
+#
+# Copyright (C) 2014 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""
+Given a target-files zipfile that does not contain images (ie, does
+not have an IMAGES/ top-level subdirectory), produce the images and
+add them to the zipfile.
+
+Usage: add_img_to_target_files target_files
+"""
+
+import sys
+
+if sys.hexversion < 0x02070000:
+ print >> sys.stderr, "Python 2.7 or newer is required."
+ sys.exit(1)
+
+import errno
+import os
+import re
+import shutil
+import subprocess
+import tempfile
+import zipfile
+
+# missing in Python 2.4 and before
+if not hasattr(os, "SEEK_SET"):
+ os.SEEK_SET = 0
+
+import build_image
+import common
+
+OPTIONS = common.OPTIONS
+
+
+def AddSystem(output_zip, sparse=True, prefix="IMAGES/"):
+ """Turn the contents of SYSTEM into a system image and store it in
+ output_zip."""
+ data = BuildSystem(OPTIONS.input_tmp, OPTIONS.info_dict, sparse=sparse)
+ common.ZipWriteStr(output_zip, prefix + "system.img", data)
+
+def BuildSystem(input_dir, info_dict, sparse=True, map_file=None):
+ return CreateImage(input_dir, info_dict, "system",
+ sparse=sparse, map_file=map_file)
+
+def AddVendor(output_zip, sparse=True, prefix="IMAGES/"):
+ data = BuildVendor(OPTIONS.input_tmp, OPTIONS.info_dict, sparse=sparse)
+ common.ZipWriteStr(output_zip, prefix + "vendor.img", data)
+
+def BuildVendor(input_dir, info_dict, sparse=True, map_file=None):
+ return CreateImage(input_dir, info_dict, "vendor",
+ sparse=sparse, map_file=map_file)
+
+
+def CreateImage(input_dir, info_dict, what, sparse=True, map_file=None):
+ print "creating " + what + ".img..."
+
+ img = tempfile.NamedTemporaryFile()
+
+ # The name of the directory it is making an image out of matters to
+ # mkyaffs2image. It wants "system" but we have a directory named
+ # "SYSTEM", so create a symlink.
+ try:
+ os.symlink(os.path.join(input_dir, what.upper()),
+ os.path.join(input_dir, what))
+ except OSError, e:
+ # bogus error on my mac version?
+ # File "./build/tools/releasetools/img_from_target_files", line 86, in AddSystem
+ # os.path.join(OPTIONS.input_tmp, "system"))
+ # OSError: [Errno 17] File exists
+ if (e.errno == errno.EEXIST):
+ pass
+
+ image_props = build_image.ImagePropFromGlobalDict(info_dict, what)
+ fstab = info_dict["fstab"]
+ if fstab:
+ image_props["fs_type" ] = fstab["/" + what].fs_type
+
+ if what == "system":
+ fs_config_prefix = ""
+ else:
+ fs_config_prefix = what + "_"
+
+ fs_config = os.path.join(
+ input_dir, "META/" + fs_config_prefix + "filesystem_config.txt")
+ if not os.path.exists(fs_config): fs_config = None
+
+ fc_config = os.path.join(input_dir, "BOOT/RAMDISK/file_contexts")
+ if not os.path.exists(fc_config): fc_config = None
+
+ succ = build_image.BuildImage(os.path.join(input_dir, what),
+ image_props, img.name,
+ fs_config=fs_config,
+ fc_config=fc_config)
+ assert succ, "build " + what + ".img image failed"
+
+ mapdata = None
+
+ if sparse:
+ data = open(img.name).read()
+ img.close()
+ else:
+ success, name = build_image.UnsparseImage(img.name, replace=False)
+ if not success:
+ assert False, "unsparsing " + what + ".img failed"
+
+ if map_file:
+ mmap = tempfile.NamedTemporaryFile()
+ mimg = tempfile.NamedTemporaryFile(delete=False)
+ success = build_image.MappedUnsparseImage(
+ img.name, name, mmap.name, mimg.name)
+ if not success:
+ assert False, "creating sparse map failed"
+ os.unlink(name)
+ name = mimg.name
+
+ with open(mmap.name) as f:
+ mapdata = f.read()
+
+ try:
+ with open(name) as f:
+ data = f.read()
+ finally:
+ os.unlink(name)
+
+ if mapdata is None:
+ return data
+ else:
+ return mapdata, data
+
+
+def AddUserdata(output_zip, prefix="IMAGES/"):
+ """Create an empty userdata image and store it in output_zip."""
+
+ image_props = build_image.ImagePropFromGlobalDict(OPTIONS.info_dict,
+ "data")
+ # We only allow yaffs to have a 0/missing partition_size.
+ # Extfs, f2fs must have a size. Skip userdata.img if no size.
+ if (not image_props.get("fs_type", "").startswith("yaffs") and
+ not image_props.get("partition_size")):
+ return
+
+ print "creating userdata.img..."
+
+ # The name of the directory it is making an image out of matters to
+ # mkyaffs2image. So we create a temp dir, and within it we create an
+ # empty dir named "data", and build the image from that.
+ temp_dir = tempfile.mkdtemp()
+ user_dir = os.path.join(temp_dir, "data")
+ os.mkdir(user_dir)
+ img = tempfile.NamedTemporaryFile()
+
+ fstab = OPTIONS.info_dict["fstab"]
+ if fstab:
+ image_props["fs_type" ] = fstab["/data"].fs_type
+ succ = build_image.BuildImage(user_dir, image_props, img.name)
+ assert succ, "build userdata.img image failed"
+
+ common.CheckSize(img.name, "userdata.img", OPTIONS.info_dict)
+ output_zip.write(img.name, prefix + "userdata.img")
+ img.close()
+ os.rmdir(user_dir)
+ os.rmdir(temp_dir)
+
+
+def AddCache(output_zip, prefix="IMAGES/"):
+ """Create an empty cache image and store it in output_zip."""
+
+ image_props = build_image.ImagePropFromGlobalDict(OPTIONS.info_dict,
+ "cache")
+ # The build system has to explicitly request for cache.img.
+ if "fs_type" not in image_props:
+ return
+
+ print "creating cache.img..."
+
+ # The name of the directory it is making an image out of matters to
+ # mkyaffs2image. So we create a temp dir, and within it we create an
+ # empty dir named "cache", and build the image from that.
+ temp_dir = tempfile.mkdtemp()
+ user_dir = os.path.join(temp_dir, "cache")
+ os.mkdir(user_dir)
+ img = tempfile.NamedTemporaryFile()
+
+ fstab = OPTIONS.info_dict["fstab"]
+ if fstab:
+ image_props["fs_type" ] = fstab["/cache"].fs_type
+ succ = build_image.BuildImage(user_dir, image_props, img.name)
+ assert succ, "build cache.img image failed"
+
+ common.CheckSize(img.name, "cache.img", OPTIONS.info_dict)
+ output_zip.write(img.name, prefix + "cache.img")
+ img.close()
+ os.rmdir(user_dir)
+ os.rmdir(temp_dir)
+
+
+def AddImagesToTargetFiles(filename):
+ OPTIONS.input_tmp, input_zip = common.UnzipTemp(filename)
+ try:
+
+ for n in input_zip.namelist():
+ if n.startswith("IMAGES/"):
+ print "target_files appears to already contain images."
+ sys.exit(1)
+
+ try:
+ input_zip.getinfo("VENDOR/")
+ has_vendor = True
+ except KeyError:
+ has_vendor = False
+
+ OPTIONS.info_dict = common.LoadInfoDict(input_zip)
+ if "selinux_fc" in OPTIONS.info_dict:
+ OPTIONS.info_dict["selinux_fc"] = os.path.join(
+ OPTIONS.input_tmp, "BOOT", "RAMDISK", "file_contexts")
+
+ input_zip.close()
+ output_zip = zipfile.ZipFile(filename, "a",
+ compression=zipfile.ZIP_DEFLATED)
+
+ def banner(s):
+ print "\n\n++++ " + s + " ++++\n\n"
+
+ banner("boot")
+ boot_image = common.GetBootableImage(
+ "IMAGES/boot.img", "boot.img", OPTIONS.input_tmp, "BOOT")
+ if boot_image:
+ boot_image.AddToZip(output_zip)
+
+ banner("recovery")
+ recovery_image = common.GetBootableImage(
+ "IMAGES/recovery.img", "recovery.img", OPTIONS.input_tmp, "RECOVERY")
+ if recovery_image:
+ recovery_image.AddToZip(output_zip)
+
+ banner("system")
+ AddSystem(output_zip)
+ if has_vendor:
+ banner("vendor")
+ AddVendor(output_zip)
+ banner("userdata")
+ AddUserdata(output_zip)
+ banner("cache")
+ AddCache(output_zip)
+
+ output_zip.close()
+
+ finally:
+ shutil.rmtree(OPTIONS.input_tmp)
+
+
+def main(argv):
+ args = common.ParseOptions(argv, __doc__)
+
+ if len(args) != 1:
+ common.Usage(__doc__)
+ sys.exit(1)
+
+ AddImagesToTargetFiles(args[0])
+ print "done."
+
+if __name__ == '__main__':
+ try:
+ common.CloseInheritedPipes()
+ main(sys.argv[1:])
+ except common.ExternalError, e:
+ print
+ print " ERROR: %s" % (e,)
+ print
+ sys.exit(1)
diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py
index f2f35f4..15964b1 100644
--- a/tools/releasetools/common.py
+++ b/tools/releasetools/common.py
@@ -1049,8 +1049,14 @@
_, _, patch = d.ComputePatch()
output_sink("recovery-from-boot.p", patch)
- boot_type, boot_device = GetTypeAndDevice("/boot", info_dict)
- recovery_type, recovery_device = GetTypeAndDevice("/recovery", info_dict)
+ td_pair = GetTypeAndDevice("/boot", info_dict)
+ if not td_pair:
+ return
+ boot_type, boot_device = td_pair
+ td_pair = GetTypeAndDevice("/recovery", info_dict)
+ if not td_pair:
+ return
+ recovery_type, recovery_device = td_pair
sh = """#!/system/bin/sh
if ! applypatch -c %(recovery_type)s:%(recovery_device)s:%(recovery_size)d:%(recovery_sha1)s; then
diff --git a/tools/releasetools/img_from_target_files.py b/tools/releasetools/img_from_target_files.py
index 9aab41c..6463047 100755
--- a/tools/releasetools/img_from_target_files.py
+++ b/tools/releasetools/img_from_target_files.py
@@ -20,9 +20,6 @@
Usage: img_from_target_files [flags] input_target_files output_image_zip
- -b (--board_config) <file>
- Deprecated.
-
-z (--bootable_zip)
Include only the bootable images (eg 'boot' and 'recovery') in
the output.
@@ -47,174 +44,11 @@
if not hasattr(os, "SEEK_SET"):
os.SEEK_SET = 0
-import build_image
import common
OPTIONS = common.OPTIONS
-def AddSystem(output_zip, sparse=True):
- """Turn the contents of SYSTEM into a system image and store it in
- output_zip."""
- data = BuildSystem(OPTIONS.input_tmp, OPTIONS.info_dict, sparse=sparse)
- common.ZipWriteStr(output_zip, "system.img", data)
-
-def BuildSystem(input_dir, info_dict, sparse=True, map_file=None):
- return CreateImage(input_dir, info_dict, "system",
- sparse=sparse, map_file=map_file)
-
-def AddVendor(output_zip, sparse=True):
- data = BuildVendor(OPTIONS.input_tmp, OPTIONS.info_dict, sparse=sparse)
- common.ZipWriteStr(output_zip, "vendor.img", data)
-
-def BuildVendor(input_dir, info_dict, sparse=True, map_file=None):
- return CreateImage(input_dir, info_dict, "vendor",
- sparse=sparse, map_file=map_file)
-
-
-def CreateImage(input_dir, info_dict, what, sparse=True, map_file=None):
- print "creating " + what + ".img..."
-
- img = tempfile.NamedTemporaryFile()
-
- # The name of the directory it is making an image out of matters to
- # mkyaffs2image. It wants "system" but we have a directory named
- # "SYSTEM", so create a symlink.
- try:
- os.symlink(os.path.join(input_dir, what.upper()),
- os.path.join(input_dir, what))
- except OSError, e:
- # bogus error on my mac version?
- # File "./build/tools/releasetools/img_from_target_files", line 86, in AddSystem
- # os.path.join(OPTIONS.input_tmp, "system"))
- # OSError: [Errno 17] File exists
- if (e.errno == errno.EEXIST):
- pass
-
- image_props = build_image.ImagePropFromGlobalDict(info_dict, what)
- fstab = info_dict["fstab"]
- if fstab:
- image_props["fs_type" ] = fstab["/" + what].fs_type
-
- if what == "system":
- fs_config_prefix = ""
- else:
- fs_config_prefix = what + "_"
-
- fs_config = os.path.join(
- input_dir, "META/" + fs_config_prefix + "filesystem_config.txt")
- if not os.path.exists(fs_config): fs_config = None
-
- fc_config = os.path.join(input_dir, "BOOT/RAMDISK/file_contexts")
- if not os.path.exists(fc_config): fc_config = None
-
- succ = build_image.BuildImage(os.path.join(input_dir, what),
- image_props, img.name,
- fs_config=fs_config,
- fc_config=fc_config)
- assert succ, "build " + what + ".img image failed"
-
- mapdata = None
-
- if sparse:
- data = open(img.name).read()
- img.close()
- else:
- success, name = build_image.UnsparseImage(img.name, replace=False)
- if not success:
- assert False, "unsparsing " + what + ".img failed"
-
- if map_file:
- mmap = tempfile.NamedTemporaryFile()
- mimg = tempfile.NamedTemporaryFile(delete=False)
- success = build_image.MappedUnsparseImage(
- img.name, name, mmap.name, mimg.name)
- if not success:
- assert False, "creating sparse map failed"
- os.unlink(name)
- name = mimg.name
-
- with open(mmap.name) as f:
- mapdata = f.read()
-
- try:
- with open(name) as f:
- data = f.read()
- finally:
- os.unlink(name)
-
- if mapdata is None:
- return data
- else:
- return mapdata, data
-
-
-def AddUserdata(output_zip):
- """Create an empty userdata image and store it in output_zip."""
-
- image_props = build_image.ImagePropFromGlobalDict(OPTIONS.info_dict,
- "data")
- # We only allow yaffs to have a 0/missing partition_size.
- # Extfs, f2fs must have a size. Skip userdata.img if no size.
- if (not image_props.get("fs_type", "").startswith("yaffs") and
- not image_props.get("partition_size")):
- return
-
- print "creating userdata.img..."
-
- # The name of the directory it is making an image out of matters to
- # mkyaffs2image. So we create a temp dir, and within it we create an
- # empty dir named "data", and build the image from that.
- temp_dir = tempfile.mkdtemp()
- user_dir = os.path.join(temp_dir, "data")
- os.mkdir(user_dir)
- img = tempfile.NamedTemporaryFile()
-
- fstab = OPTIONS.info_dict["fstab"]
- if fstab:
- image_props["fs_type" ] = fstab["/data"].fs_type
- succ = build_image.BuildImage(user_dir, image_props, img.name)
- assert succ, "build userdata.img image failed"
-
- common.CheckSize(img.name, "userdata.img", OPTIONS.info_dict)
- output_zip.write(img.name, "userdata.img")
- img.close()
- os.rmdir(user_dir)
- os.rmdir(temp_dir)
-
-
-def AddCache(output_zip):
- """Create an empty cache image and store it in output_zip."""
-
- image_props = build_image.ImagePropFromGlobalDict(OPTIONS.info_dict,
- "cache")
- # The build system has to explicitly request for cache.img.
- if "fs_type" not in image_props:
- return
-
- print "creating cache.img..."
-
- # The name of the directory it is making an image out of matters to
- # mkyaffs2image. So we create a temp dir, and within it we create an
- # empty dir named "cache", and build the image from that.
- temp_dir = tempfile.mkdtemp()
- user_dir = os.path.join(temp_dir, "cache")
- os.mkdir(user_dir)
- img = tempfile.NamedTemporaryFile()
-
- fstab = OPTIONS.info_dict["fstab"]
- if fstab:
- image_props["fs_type" ] = fstab["/cache"].fs_type
- succ = build_image.BuildImage(user_dir, image_props, img.name)
- assert succ, "build cache.img image failed"
-
- common.CheckSize(img.name, "cache.img", OPTIONS.info_dict)
- output_zip.write(img.name, "cache.img")
- img.close()
- os.rmdir(user_dir)
- os.rmdir(temp_dir)
-
-
def CopyInfo(output_zip):
"""Copy the android-info.txt file from the input to the output."""
output_zip.write(os.path.join(OPTIONS.input_tmp, "OTA", "android-info.txt"),
@@ -225,8 +59,6 @@
bootable_only = [False]
def option_handler(o, a):
- if o in ("-b", "--board_config"):
- pass # deprecated
if o in ("-z", "--bootable_zip"):
bootable_only[0] = True
else:
@@ -234,9 +66,8 @@
return True
args = common.ParseOptions(argv, __doc__,
- extra_opts="b:z",
- extra_long_opts=["board_config=",
- "bootable_zip"],
+ extra_opts="z",
+ extra_long_opts=["bootable_zip"],
extra_option_handler=option_handler)
bootable_only = bootable_only[0]
@@ -246,48 +77,69 @@
sys.exit(1)
OPTIONS.input_tmp, input_zip = common.UnzipTemp(args[0])
- OPTIONS.info_dict = common.LoadInfoDict(input_zip)
-
- # If this image was originally labelled with SELinux contexts, make sure we
- # also apply the labels in our new image. During building, the "file_contexts"
- # is in the out/ directory tree, but for repacking from target-files.zip it's
- # in the root directory of the ramdisk.
- if "selinux_fc" in OPTIONS.info_dict:
- OPTIONS.info_dict["selinux_fc"] = os.path.join(OPTIONS.input_tmp, "BOOT", "RAMDISK",
- "file_contexts")
-
output_zip = zipfile.ZipFile(args[1], "w", compression=zipfile.ZIP_DEFLATED)
+ CopyInfo(output_zip)
- boot_image = common.GetBootableImage(
- "boot.img", "boot.img", OPTIONS.input_tmp, "BOOT")
- if boot_image:
- boot_image.AddToZip(output_zip)
- recovery_image = common.GetBootableImage(
- "recovery.img", "recovery.img", OPTIONS.input_tmp, "RECOVERY")
- if recovery_image:
- recovery_image.AddToZip(output_zip)
+ try:
+ done = False
+ images_path = os.path.join(OPTIONS.input_tmp, "IMAGES")
+ if os.path.exists(images_path):
+ # If this is a new target-files, it already contains the images,
+ # and all we have to do is copy them to the output zip.
+ images = os.listdir(images_path)
+ if images:
+ for i in images:
+ if bootable_only and i not in ("boot.img", "recovery.img"): continue
+ with open(os.path.join(images_path, i), "r") as f:
+ common.ZipWriteStr(output_zip, i, f.read())
+ done = True
- def banner(s):
- print "\n\n++++ " + s + " ++++\n\n"
+ if not done:
+ # We have an old target-files that doesn't already contain the
+ # images, so build them.
+ import add_img_to_target_files
- if not bootable_only:
- banner("AddSystem")
- AddSystem(output_zip)
- try:
- input_zip.getinfo("VENDOR/")
- banner("AddVendor")
- AddVendor(output_zip)
- except KeyError:
- pass # no vendor partition for this device
- banner("AddUserdata")
- AddUserdata(output_zip)
- banner("AddCache")
- AddCache(output_zip)
- CopyInfo(output_zip)
+ OPTIONS.info_dict = common.LoadInfoDict(input_zip)
- print "cleaning up..."
- output_zip.close()
- shutil.rmtree(OPTIONS.input_tmp)
+ # If this image was originally labelled with SELinux contexts,
+ # make sure we also apply the labels in our new image. During
+ # building, the "file_contexts" is in the out/ directory tree,
+ # but for repacking from target-files.zip it's in the root
+ # directory of the ramdisk.
+ if "selinux_fc" in OPTIONS.info_dict:
+ OPTIONS.info_dict["selinux_fc"] = os.path.join(
+ OPTIONS.input_tmp, "BOOT", "RAMDISK", "file_contexts")
+
+ boot_image = common.GetBootableImage(
+ "boot.img", "boot.img", OPTIONS.input_tmp, "BOOT")
+ if boot_image:
+ boot_image.AddToZip(output_zip)
+ recovery_image = common.GetBootableImage(
+ "recovery.img", "recovery.img", OPTIONS.input_tmp, "RECOVERY")
+ if recovery_image:
+ recovery_image.AddToZip(output_zip)
+
+ def banner(s):
+ print "\n\n++++ " + s + " ++++\n\n"
+
+ if not bootable_only:
+ banner("AddSystem")
+ add_img_to_target_files.AddSystem(output_zip, prefix="")
+ try:
+ input_zip.getinfo("VENDOR/")
+ banner("AddVendor")
+ add_img_to_target_files.AddVendor(output_zip, prefix="")
+ except KeyError:
+ pass # no vendor partition for this device
+ banner("AddUserdata")
+ add_img_to_target_files.AddUserdata(output_zip, prefix="")
+ banner("AddCache")
+ add_img_to_target_files.AddCache(output_zip, prefix="")
+
+ finally:
+ print "cleaning up..."
+ output_zip.close()
+ shutil.rmtree(OPTIONS.input_tmp)
print "done."
diff --git a/tools/releasetools/ota_from_target_files b/tools/releasetools/ota_from_target_files
index 5f2354c..54d4884 100755
--- a/tools/releasetools/ota_from_target_files
+++ b/tools/releasetools/ota_from_target_files
@@ -98,7 +98,6 @@
from sha import sha as sha1
import common
-import img_from_target_files
import edify_generator
import build_image
@@ -418,6 +417,63 @@
GetOemProperty("ro.product.device", oem_props, oem_dict, info_dict),
GetBuildProp("ro.build.thumbprint", info_dict))
+def GetImage(which, tmpdir, info_dict):
+ # Return (mapdata, data) for the given image. which should be
+ # "system" or "vendor".
+
+ assert which in ("system", "vendor")
+
+ path = os.path.join(tmpdir, "IMAGES", which + ".img")
+ if os.path.exists(path):
+ print "using %s.img from target-files" % (which,)
+
+ # This is a 'new' target-files, which already has the image in it.
+ # The image is a sparse image, though, so we need to unsparse it
+ # and extract the map data.
+
+ success, name = build_image.UnsparseImage(path, replace=False)
+ if not success:
+ assert False, "unsparsing " + which + ".img failed"
+
+ mmap = tempfile.NamedTemporaryFile()
+ mimg = tempfile.NamedTemporaryFile(delete=False)
+ success = build_image.MappedUnsparseImage(
+ path, name, mmap.name, mimg.name)
+ if not success:
+ assert False, "creating sparse map failed"
+ os.unlink(name)
+ name = mimg.name
+
+ with open(mmap.name) as f:
+ mapdata = f.read()
+
+ try:
+ with open(name) as f:
+ data = f.read()
+ finally:
+ os.unlink(name)
+
+ print "unsparsed data sha1 is " + sha1(data).hexdigest()
+ return mapdata, data
+
+ else:
+ print "building %s.img from target-files" % (which,)
+
+ # This is an 'old' target-files, which does not contain images
+ # already built. Build them.
+
+ import add_img_to_target_files
+ if which == "system":
+ mapdata, data = add_img_to_target_files.BuildSystem(
+ tmpdir, info_dict, sparse=False, map_file=True)
+ elif which == "vendor":
+ mapdata, data = add_img_to_target_files.BuildVendor(
+ tmpdir, info_dict, sparse=False, map_file=True)
+
+ print "built data sha1 is " + sha1(data).hexdigest()
+ return mapdata, data
+
+
def WriteFullOTAPackage(input_zip, output_zip):
# TODO: how to determine this? We don't know what version it will
# be installed on top of. For now, we expect the API just won't
@@ -514,9 +570,7 @@
system_items = ItemSet("system", "META/filesystem_config.txt")
script.ShowProgress(system_progress, 0)
if block_based:
- mapdata, data = img_from_target_files.BuildSystem(
- OPTIONS.input_tmp, OPTIONS.info_dict,
- sparse=False, map_file=True)
+ mapdata, data = GetImage("system", OPTIONS.input_tmp, OPTIONS.info_dict)
common.ZipWriteStr(output_zip, "system.map", mapdata)
common.ZipWriteStr(output_zip, "system.muimg", data)
@@ -551,9 +605,7 @@
script.ShowProgress(0.1, 0)
if block_based:
- mapdata, data = img_from_target_files.BuildVendor(
- OPTIONS.input_tmp, OPTIONS.info_dict,
- sparse=False, map_file=True)
+ mapdata, data = GetImage("vendor", OPTIONS.input_tmp, OPTIONS.info_dict)
common.ZipWriteStr(output_zip, "vendor.map", mapdata)
common.ZipWriteStr(output_zip, "vendor.muimg", data)
@@ -647,14 +699,14 @@
dirs.pop()
class BlockDifference:
- def __init__(self, partition, builder, output_zip):
+ def __init__(self, partition, output_zip):
with tempfile.NamedTemporaryFile() as src_file:
with tempfile.NamedTemporaryFile() as tgt_file:
print "building source " + partition + " image..."
src_file = tempfile.NamedTemporaryFile()
- src_mapdata, src_data = builder(OPTIONS.source_tmp,
- OPTIONS.source_info_dict,
- sparse=False, map_file=True)
+ src_mapdata, src_data = GetImage(partition,
+ OPTIONS.source_tmp,
+ OPTIONS.source_info_dict)
self.src_sha1 = sha1(src_data).hexdigest()
print "source " + partition + " sha1:", self.src_sha1
@@ -662,9 +714,9 @@
print "building target " + partition + " image..."
tgt_file = tempfile.NamedTemporaryFile()
- tgt_mapdata, tgt_data = builder(OPTIONS.target_tmp,
- OPTIONS.target_info_dict,
- sparse=False, map_file=True)
+ tgt_mapdata, tgt_data = GetImage(partition,
+ OPTIONS.target_tmp,
+ OPTIONS.target_info_dict)
self.tgt_sha1 = sha1(tgt_data).hexdigest()
print "target " + partition + " sha1:", self.tgt_sha1
tgt_len = len(tgt_data)
@@ -731,13 +783,11 @@
"/tmp/recovery.img", "recovery.img", OPTIONS.target_tmp, "RECOVERY")
updating_recovery = (source_recovery.data != target_recovery.data)
- system_diff = BlockDifference("system", img_from_target_files.BuildSystem,
- output_zip)
+ system_diff = BlockDifference("system", output_zip)
if HasVendorPartition(target_zip):
if not HasVendorPartition(source_zip):
raise RuntimeError("can't generate incremental that adds /vendor")
- vendor_diff = BlockDifference("vendor", img_from_target_files.BuildVendor,
- output_zip)
+ vendor_diff = BlockDifference("vendor", output_zip)
oem_props = OPTIONS.target_info_dict.get("oem_fingerprint_properties")
oem_dict = None
diff --git a/tools/releasetools/sign_target_files_apks b/tools/releasetools/sign_target_files_apks
index 0ecb906..cba0668 100755
--- a/tools/releasetools/sign_target_files_apks
+++ b/tools/releasetools/sign_target_files_apks
@@ -82,6 +82,7 @@
import tempfile
import zipfile
+import add_img_to_target_files
import common
OPTIONS = common.OPTIONS
@@ -166,6 +167,8 @@
f.write(data)
for info in input_tf_zip.infolist():
+ if info.filename.startswith("IMAGES/"): continue
+
data = input_tf_zip.read(info.filename)
out_info = copy.copy(info)
@@ -448,6 +451,8 @@
input_zip.close()
output_zip.close()
+ add_img_to_target_files.AddImagesToTargetFiles(args[1])
+
print "done."