Merge "Use libgcov OR libclang_rt.profile, not both."
diff --git a/core/Makefile b/core/Makefile
index b7a457d..0c9a825 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -1606,6 +1606,10 @@
$(hide) for part in $(UPDATE_AB_PARTITIONS); do \
echo "$${part}" >> $(zip_root)/META/ab_partitions.txt; \
done
+ifdef OSRELEASED_DIRECTORY
+ $(hide) $(ACP) $(TARGET_OUT_ETC)/$(OSRELEASED_DIRECTORY)/product_id $(zip_root)/META/product_id.txt
+ $(hide) $(ACP) $(TARGET_OUT_ETC)/$(OSRELEASED_DIRECTORY)/product_version $(zip_root)/META/product_version.txt
+endif
endif
ifeq ($(BREAKPAD_GENERATE_SYMBOLS),true)
@# If breakpad symbols have been generated, add them to the zip.
diff --git a/core/binary.mk b/core/binary.mk
index a290eef..f2d72a5 100644
--- a/core/binary.mk
+++ b/core/binary.mk
@@ -673,18 +673,20 @@
ifdef LOCAL_DBUS_PROXY_PREFIX
$(dbus_generated_headers) : $(dbus_definition_paths)
$(generate-dbus-proxies)
+else
+$(dbus_generated_headers) : $(dbus_header_dir)/%.h : $(LOCAL_PATH)/%.dbus-xml
+ $(generate-dbus-adaptors)
+endif # $(LOCAL_DBUS_PROXY_PREFIX)
+endif # $(my_prefix)_$(LOCAL_MODULE_CLASS)_$(LOCAL_MODULE)_dbus_bindings_defined
+ifdef LOCAL_DBUS_PROXY_PREFIX
# Auto-export the generated dbus proxy directory.
my_export_c_include_dirs += $(dbus_gen_dir)/include
my_c_includes += $(dbus_gen_dir)/include
else
-$(dbus_generated_headers) : $(dbus_header_dir)/%.h : $(LOCAL_PATH)/%.dbus-xml
- $(generate-dbus-adaptors)
-
my_export_c_include_dirs += $(dbus_header_dir)
my_c_includes += $(dbus_header_dir)
endif # $(LOCAL_DBUS_PROXY_PREFIX)
-endif # $(my_prefix)_$(LOCAL_MODULE_CLASS)_$(LOCAL_MODULE)_dbus_bindings_defined
my_generated_sources += $(dbus_generated_headers)
diff --git a/core/combo/mac_version.mk b/core/combo/mac_version.mk
index 638e3a0..f6bd852 100644
--- a/core/combo/mac_version.mk
+++ b/core/combo/mac_version.mk
@@ -9,7 +9,7 @@
build_mac_version := $(shell sw_vers -productVersion)
-mac_sdk_versions_supported := 10.8 10.9 10.10
+mac_sdk_versions_supported := 10.8 10.9 10.10 10.11
ifneq ($(strip $(MAC_SDK_VERSION)),)
mac_sdk_version := $(MAC_SDK_VERSION)
ifeq ($(filter $(mac_sdk_version),$(mac_sdk_versions_supported)),)
diff --git a/core/definitions.mk b/core/definitions.mk
index 5f8fd06..f2fa8a8 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -182,16 +182,53 @@
endef
###########################################################
+## Find all of the directories under the named directories with
+## the specified name.
+## Meant to be used like:
+## INC_DIRS := $(call all-named-dirs-under,inc,.)
+###########################################################
+
+define all-named-dirs-under
+$(call find-subdir-files,$(2) -type d -name "$(1)")
+endef
+
+###########################################################
+## Find all the directories under the current directory that
+## haves name that match $(1)
+###########################################################
+
+define all-subdir-named-dirs
+$(call all-named-dirs-under,$(1),.)
+endef
+
+###########################################################
+## Find all of the files under the named directories with
+## the specified name.
+## Meant to be used like:
+## SRC_FILES := $(call all-named-files-under,*.h,src tests)
+###########################################################
+
+define all-named-files-under
+$(call find-files-in-subdirs,$(LOCAL_PATH),"$(1)",$(2))
+endef
+
+###########################################################
+## Find all of the files under the current directory with
+## the specified name.
+###########################################################
+
+define all-subdir-named-files
+$(call all-named-files-under,$(1),.)
+endef
+
+###########################################################
## Find all of the java files under the named directories.
## Meant to be used like:
## SRC_FILES := $(call all-java-files-under,src tests)
###########################################################
define all-java-files-under
-$(sort $(patsubst ./%,%, \
- $(shell cd $(LOCAL_PATH) ; \
- find -L $(1) -name "*.java" -and -not -name ".*") \
- ))
+$(call all-named-files-under,*.java,$(1))
endef
###########################################################
@@ -210,10 +247,7 @@
###########################################################
define all-c-files-under
-$(sort $(patsubst ./%,%, \
- $(shell cd $(LOCAL_PATH) ; \
- find -L $(1) -name "*.c" -and -not -name ".*") \
- ))
+$(call all-named-files-under,*.c,$(1))
endef
###########################################################
@@ -255,10 +289,7 @@
###########################################################
define all-Iaidl-files-under
-$(sort $(patsubst ./%,%, \
- $(shell cd $(LOCAL_PATH) ; \
- find -L $(1) -name "I*.aidl" -and -not -name ".*") \
- ))
+$(call all-named-files-under,I*.aidl,$(1))
endef
###########################################################
@@ -276,10 +307,7 @@
###########################################################
define all-logtags-files-under
-$(sort $(patsubst ./%,%, \
- $(shell cd $(LOCAL_PATH) ; \
- find -L $(1) -name "*.logtags" -and -not -name ".*") \
- ))
+$(call all-named-files-under,*.logtags,$(1))
endef
###########################################################
@@ -289,10 +317,7 @@
###########################################################
define all-proto-files-under
-$(sort $(patsubst ./%,%, \
- $(shell cd $(LOCAL_PATH) ; \
- find -L $(1) -name "*.proto" -and -not -name ".*") \
- ))
+$(call all-named-files-under,*.proto,$(1))
endef
###########################################################
@@ -302,10 +327,7 @@
###########################################################
define all-renderscript-files-under
-$(sort $(patsubst ./%,%, \
- $(shell cd $(LOCAL_PATH) ; \
- find -L $(1) \( -name "*.rs" -or -name "*.fs" \) -and -not -name ".*") \
- ))
+$(call find-subdir-files,$(1) \( -name "*.rs" -or -name "*.fs" \) -and -not -name ".*")
endef
###########################################################
@@ -315,10 +337,7 @@
###########################################################
define all-S-files-under
-$(sort $(patsubst ./%,%, \
- $(shell cd $(LOCAL_PATH) ; \
- find -L $(1) -name "*.S" -and -not -name ".*") \
- ))
+$(call all-named-files-under,*.S,$(1))
endef
###########################################################
@@ -328,10 +347,7 @@
###########################################################
define all-html-files-under
-$(sort $(patsubst ./%,%, \
- $(shell cd $(LOCAL_PATH) ; \
- find -L $(1) -name "*.html" -and -not -name ".*") \
- ))
+$(call all-named-files-under,*.html,$(1))
endef
###########################################################
@@ -382,11 +398,11 @@
###########################################################
define find-other-java-files
- $(call find-subdir-files,$(1) -name "*.java" -and -not -name ".*")
+$(call all-java-files-under,$(1))
endef
define find-other-html-files
- $(call find-subdir-files,$(1) -name "*.html" -and -not -name ".*")
+$(call all-html-files-under,$(1))
endef
###########################################################
@@ -2086,11 +2102,11 @@
#
define add-carried-jack-resources
$(hide) if [ -d $(PRIVATE_JACK_INTERMEDIATES_DIR) ] ; then \
- jack_res_jar_flags=$$(find $(PRIVATE_JACK_INTERMEDIATES_DIR) -type f \
- | sed -e "s?^$(PRIVATE_JACK_INTERMEDIATES_DIR)/? -C $(PRIVATE_JACK_INTERMEDIATES_DIR) ?"); \
- if [ -n "$$jack_res_jar_flags" ] ; then \
- echo $$jack_res_jar_flags >$(dir $@)jack_res_jar_flags; \
- jar uf $@ $$jack_res_jar_flags; \
+ find $(PRIVATE_JACK_INTERMEDIATES_DIR) -type f \
+ | sed -e "s?^$(PRIVATE_JACK_INTERMEDIATES_DIR)/? -C \"$(PRIVATE_JACK_INTERMEDIATES_DIR)\" \"?" -e "s/$$/\"/" \
+ > $(dir $@)jack_res_jar_flags; \
+ if [ -s $(dir $@)jack_res_jar_flags ] ; then \
+ jar uf $@ @$(dir $@)jack_res_jar_flags; \
fi; \
fi
endef
@@ -2496,12 +2512,13 @@
endef
# Return the arch for the source file of a prebuilt
-# Return "none" if no matching arch found, so the result can be passed to
+# Return "none" if no matching arch found and return empty
+# if the input is empty, so the result can be passed to
# LOCAL_MODULE_TARGET_ARCH.
# $(1) the list of archs supported by the prebuilt
define get-prebuilt-src-arch
$(strip $(if $(filter $(TARGET_ARCH),$(1)),$(TARGET_ARCH),\
- $(if $(filter $(TARGET_2ND_ARCH),$(1)),$(TARGET_2ND_ARCH),none)))
+ $(if $(filter $(TARGET_2ND_ARCH),$(1)),$(TARGET_2ND_ARCH),$(if $(1),none))))
endef
###########################################################
diff --git a/core/main.mk b/core/main.mk
index 1ca02d1..8610492 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -179,7 +179,7 @@
ifneq ($(EXPERIMENTAL_USE_JAVA8),)
required_version := "1.8.x"
required_javac_version := "1.8"
-java_version := $(shell echo '$(java_version_str)' | grep 'openjdk .*[ "]1\.8[\. "$$]')
+java_version := $(shell echo '$(java_version_str)' | grep '[ "]1\.8[\. "$$]')
javac_version := $(shell echo '$(javac_version_str)' | grep '[ "]1\.8[\. "$$]')
else # default
required_version := "1.7.x"
diff --git a/core/ninja.mk b/core/ninja.mk
index 2ac8c8e..6fc508d 100644
--- a/core/ninja.mk
+++ b/core/ninja.mk
@@ -136,7 +136,7 @@
.INTERMEDIATE: kati.intermediate
kati.intermediate: $(KATI) $(MAKEPARALLEL)
@echo Running kati to generate build$(KATI_NINJA_SUFFIX).ninja...
- +$(hide) $(KATI_MAKEPARALLEL) $(KATI) --ninja --ninja_dir=$(OUT_DIR) --ninja_suffix=$(KATI_NINJA_SUFFIX) --regen --ignore_dirty=$(OUT_DIR)/% --ignore_optional_include=$(OUT_DIR)/%.P --detect_android_echo --use_find_emulator -f build/core/main.mk $(KATI_TARGETS) --gen_all_phony_targets --gen_all_targets BUILDING_WITH_NINJA=true
+ +$(hide) $(KATI_MAKEPARALLEL) $(KATI) --ninja --ninja_dir=$(OUT_DIR) --ninja_suffix=$(KATI_NINJA_SUFFIX) --regen --ignore_dirty=$(OUT_DIR)/% --ignore_optional_include=$(OUT_DIR)/%.P --detect_android_echo --use_find_emulator -f build/core/main.mk $(KATI_TARGETS) --gen_all_targets BUILDING_WITH_NINJA=true
KATI_CXX := $(CLANG_CXX) $(CLANG_HOST_GLOBAL_CFLAGS) $(CLANG_HOST_GLOBAL_CPPFLAGS)
KATI_LD := $(CLANG_CXX) $(CLANG_HOST_GLOBAL_LDFLAGS)
diff --git a/target/board/generic_x86/sepolicy/system_server.te b/target/board/generic_x86/sepolicy/system_server.te
deleted file mode 100644
index 5d98a14..0000000
--- a/target/board/generic_x86/sepolicy/system_server.te
+++ /dev/null
@@ -1 +0,0 @@
-allow system_server self:process execmem;
diff --git a/target/product/core_tiny.mk b/target/product/core_tiny.mk
index 2be0507..a12d2d1 100644
--- a/target/product/core_tiny.mk
+++ b/target/product/core_tiny.mk
@@ -36,9 +36,6 @@
power.default
PRODUCT_PACKAGES += \
- local_time.default
-
-PRODUCT_PACKAGES += \
BackupRestoreConfirmation \
DefaultContainerService \
SettingsProvider \
diff --git a/target/product/verity.mk b/target/product/verity.mk
index 3e00b49..6676ffe 100644
--- a/target/product/verity.mk
+++ b/target/product/verity.mk
@@ -14,15 +14,19 @@
# limitations under the License.
#
-# Provides dependencies necessary for verified boot
+# Provides dependencies necessary for verified boot (only for user and
+# userdebug builds)
-PRODUCT_SUPPORTS_BOOT_SIGNER := true
-PRODUCT_SUPPORTS_VERITY := true
+user_variant := $(filter user userdebug,$(TARGET_BUILD_VARIANT))
+ifneq (,$(user_variant))
+ PRODUCT_SUPPORTS_BOOT_SIGNER := true
+ PRODUCT_SUPPORTS_VERITY := true
-# The dev key is used to sign boot and recovery images, and the verity
-# metadata table. Actual product deliverables will be re-signed by hand.
-# We expect this file to exist with the suffixes ".x509.pem" and ".pk8".
-PRODUCT_VERITY_SIGNING_KEY := build/target/product/security/verity
+ # The dev key is used to sign boot and recovery images, and the verity
+ # metadata table. Actual product deliverables will be re-signed by hand.
+ # We expect this file to exist with the suffixes ".x509.pem" and ".pk8".
+ PRODUCT_VERITY_SIGNING_KEY := build/target/product/security/verity
-PRODUCT_PACKAGES += \
- verity_key
+ PRODUCT_PACKAGES += \
+ verity_key
+endif