Merge "Add a system property to indicate if statsd should start" into pi-dev
diff --git a/CleanSpec.mk b/CleanSpec.mk
index 0568923..7677261 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -483,6 +483,11 @@
# Remove stale init.noenforce.rc
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/init/gsi/init.noenforce.rc)
+# Clean up Launcher3 which has been replaced with Launcher3QuickStep
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/app/Launcher3)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/priv-app/Launcher3)
+$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/Launcher3_intermediates)
+
# ************************************************
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
# ************************************************
diff --git a/OWNERS b/OWNERS
index 7a59f70..1e9b763 100644
--- a/OWNERS
+++ b/OWNERS
@@ -1,3 +1,11 @@
ccross@android.com
dwillemsen@google.com
nanzhang@google.com
+
+per-file * = ccross@android.com
+per-file * = dwillemsen@google.com
+per-file * = nanzhang@google.com
+
+# for version updates
+per-file version_defaults.mk = aseaton@google.com
+per-file version_defaults.mk = elisapascual@google.com
diff --git a/core/Makefile b/core/Makefile
index a6b67ad..0a2f6e3 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -2409,7 +2409,8 @@
OTATOOLS_DEPS := \
system/extras/verity/build_verity_metadata.py \
system/extras/ext4_utils/mke2fs.conf \
- external/avb/test/data/testkey_rsa4096.pem \
+ $(sort $(shell find external/avb/test/data -type f -name "testkey_*.pem" -o \
+ -name "atx_metadata.bin")) \
$(sort $(shell find system/update_engine/scripts -name \*.pyc -prune -o -type f -print)) \
$(sort $(shell find build/target/product/security -type f -name \*.x509.pem -o -name \*.pk8 -o \
-name verity_key)) \
diff --git a/core/aapt2.mk b/core/aapt2.mk
index 4385b4d..b3a7c93 100644
--- a/core/aapt2.mk
+++ b/core/aapt2.mk
@@ -52,7 +52,7 @@
ifneq ($(my_generated_res_zips),)
my_zipped_resources_flata := $(my_compiled_res_base_dir)/zip_res.flata
$(my_zipped_resources_flata): PRIVATE_SOURCE_RES_ZIPS := $(my_generated_res_zips)
-$(my_zipped_resources_flata) : $(my_generated_res_deps) $(AAPT2) $(ZIPSYNC)
+$(my_zipped_resources_flata) : $(my_generated_res_zips) $(AAPT2) $(ZIPSYNC)
@echo "AAPT2 compile $@ <- $(PRIVATE_SOURCE_RES_ZIPS)"
$(call aapt2-compile-resource-zips)
diff --git a/core/clear_vars.mk b/core/clear_vars.mk
index 95a6553..1e2eda2 100644
--- a/core/clear_vars.mk
+++ b/core/clear_vars.mk
@@ -74,6 +74,10 @@
LOCAL_DROIDDOC_STUB_OUT_DIR:=
LOCAL_DROIDDOC_TEMPLATE_DIR:=
LOCAL_DROIDDOC_USE_STANDARD_DOCLET:=
+LOCAL_DROIDDOC_USE_METALAVA:=
+LOCAL_DROIDDOC_METALAVA_PREVIOUS_API:=
+LOCAL_DROIDDOC_METALAVA_ANNOTATIONS_ENABLED:=
+LOCAL_DROIDDOC_METALAVA_MERGE_ANNOTATIONS_DIR:=
LOCAL_DX_FLAGS:=
LOCAL_EMMA_COVERAGE_FILTER:=
LOCAL_EMMA_INSTRUMENT:=
diff --git a/core/config.mk b/core/config.mk
index 20dbddc..d218408 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -1009,6 +1009,7 @@
TARGET_SDK_VERSIONS_WITHOUT_JAVA_19_SUPPORT := $(call numbers_less_than,27,$(TARGET_AVAILABLE_SDK_VERSIONS))
INTERNAL_PLATFORM_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/public_api.txt
+INTERNAL_PLATFORM_DEX_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/public-dex.txt
INTERNAL_PLATFORM_PRIVATE_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/private.txt
INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/private-dex.txt
INTERNAL_PLATFORM_REMOVED_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/removed.txt
diff --git a/core/config_sanitizers.mk b/core/config_sanitizers.mk
index 9ea1ff4..d570ccd 100644
--- a/core/config_sanitizers.mk
+++ b/core/config_sanitizers.mk
@@ -96,15 +96,17 @@
my_sanitize_diag :=
endif
-# Enable CFI in included paths.
+# Enable CFI in included paths (for Arm64 only).
ifeq ($(filter cfi, $(my_sanitize)),)
- combined_include_paths := $(CFI_INCLUDE_PATHS) \
- $(PRODUCT_CFI_INCLUDE_PATHS)
+ ifneq ($(filter arm64,$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)),)
+ combined_include_paths := $(CFI_INCLUDE_PATHS) \
+ $(PRODUCT_CFI_INCLUDE_PATHS)
- ifneq ($(strip $(foreach dir,$(subst $(comma),$(space),$(combined_include_paths)),\
- $(filter $(dir)%,$(LOCAL_PATH)))),)
- my_sanitize := cfi $(my_sanitize)
- my_sanitize_diag := cfi $(my_sanitize_diag)
+ ifneq ($(strip $(foreach dir,$(subst $(comma),$(space),$(combined_include_paths)),\
+ $(filter $(dir)%,$(LOCAL_PATH)))),)
+ my_sanitize := cfi $(my_sanitize)
+ my_sanitize_diag := cfi $(my_sanitize_diag)
+ endif
endif
endif
@@ -330,6 +332,7 @@
ifeq ($(filter STATIC_LIBRARIES,$(LOCAL_MODULE_CLASS)),)
ifndef LOCAL_SDK_VERSION
my_static_libraries += $($(LOCAL_2ND_ARCH_VAR_PREFIX)UBSAN_MINIMAL_RUNTIME_LIBRARY)
+ my_ldflags += -Wl,--exclude-libs,$($(LOCAL_2ND_ARCH_VAR_PREFIX)UBSAN_MINIMAL_RUNTIME_LIBRARY).a
endif
endif
ifneq ($(filter unsigned-integer-overflow signed-integer-overflow integer,$(my_sanitize)),)
diff --git a/core/definitions.mk b/core/definitions.mk
index c959992..599ab49 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -2086,7 +2086,7 @@
define aapt2-compile-resource-zips
@mkdir -p $(dir $@)
$(ZIPSYNC) -d $@.contents -l $@.list $(PRIVATE_SOURCE_RES_ZIPS)
-$(hide) $(AAPT2) compile -o $@ --dir $@.tmp $(PRIVATE_AAPT2_CFLAGS) --legacy
+$(hide) $(AAPT2) compile -o $@ --dir $@.contents $(PRIVATE_AAPT2_CFLAGS) --legacy
endef
# Set up rule to compile one resource file with aapt2.
diff --git a/core/dex_preopt_odex_install.mk b/core/dex_preopt_odex_install.mk
index d56c68a..ce91759 100644
--- a/core/dex_preopt_odex_install.mk
+++ b/core/dex_preopt_odex_install.mk
@@ -118,13 +118,9 @@
ifeq (true,$(my_process_profile))
-ifdef LOCAL_VENDOR_MODULE
-$(call pretty-error, Internal error: profiles are not supported for vendor modules)
-else
ifeq (,$(LOCAL_DEX_PREOPT_APP_IMAGE))
LOCAL_DEX_PREOPT_APP_IMAGE := true
endif
-endif
ifndef LOCAL_DEX_PREOPT_PROFILE
$(call pretty-error,Must have specified class listing (LOCAL_DEX_PREOPT_PROFILE))
diff --git a/core/droiddoc.mk b/core/droiddoc.mk
index b174f31..ae64052 100644
--- a/core/droiddoc.mk
+++ b/core/droiddoc.mk
@@ -15,12 +15,9 @@
#
$(call record-module-type,DROIDDOC)
-##
-##
-## Common to both droiddoc and javadoc
-##
-##
-
+###########################################################
+## Common logic to both droiddoc and javadoc
+###########################################################
LOCAL_IS_HOST_MODULE := $(call true-or-empty,$(LOCAL_IS_HOST_MODULE))
ifeq ($(LOCAL_IS_HOST_MODULE),true)
my_prefix := HOST_
@@ -54,6 +51,7 @@
endif
ifeq ($(LOCAL_IS_HOST_MODULE),true)
+
$(full_target): PRIVATE_BOOTCLASSPATH :=
full_java_libs := $(addprefix $(HOST_OUT_JAVA_LIBRARIES)/,\
$(addsuffix $(COMMON_JAVA_PACKAGE_SUFFIX),$(LOCAL_JAVA_LIBRARIES)))
@@ -128,18 +126,10 @@
$(hide) for d in $(3) ; do find $$d -name '*.java' -and -not -name '.*' >> $(1) 2> /dev/null ; done ; true
endef
-ifeq (a,b)
-$(full_target): PRIVATE_PROFILING_OPTIONS := \
- -J-agentlib:jprofilerti=port=8849 -J-Xbootclasspath/a:/Applications/jprofiler5/bin/agent.jar
-endif
-
-
+###########################################################
+## Logic for droiddoc only
+###########################################################
ifneq ($(strip $(LOCAL_DROIDDOC_USE_STANDARD_DOCLET)),true)
-##
-##
-## droiddoc only
-##
-##
droiddoc_templates := \
$(sort $(shell find $(LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR) -type f $(if $(ALLOW_MISSING_DEPENDENCIES),2>/dev/null)))
@@ -150,10 +140,6 @@
endif
endif
-droiddoc := \
- $(HOST_JDK_TOOLS_JAR) \
- $(HOST_OUT_JAVA_LIBRARIES)/doclava$(COMMON_JAVA_PACKAGE_SUFFIX)
-
$(full_target): PRIVATE_DOCLETPATH := $(HOST_OUT_JAVA_LIBRARIES)/jsilver$(COMMON_JAVA_PACKAGE_SUFFIX):$(HOST_OUT_JAVA_LIBRARIES)/doclava$(COMMON_JAVA_PACKAGE_SUFFIX)
$(full_target): PRIVATE_CURRENT_BUILD := -hdf page.build $(BUILD_ID)-$(BUILD_NUMBER_FROM_FILE)
$(full_target): PRIVATE_CURRENT_TIME := -hdf page.now "$$($(DATE_FROM_FILE) "+%d %b %Y %k:%M")"
@@ -175,18 +161,127 @@
$(full_target): PRIVATE_ADDITIONAL_HTML_DIR :=
endif
-# TODO: not clear if this is used any more
+# TODO(nanzhang): Remove it if this is not used any more
$(full_target): PRIVATE_LOCAL_PATH := $(LOCAL_PATH)
+ifeq ($(strip $(LOCAL_DROIDDOC_USE_METALAVA)),true)
+ifneq (,$(filter --generate-documentation,$(LOCAL_DROIDDOC_OPTIONS)))
+
+pos = $(if $(findstring $1,$2),$(call pos,$1,$(wordlist 2,$(words $2),$2),x $3),$3)
+metalava_args := $(wordlist 1, $(words $(call pos,--generate-documentation,$(LOCAL_DROIDDOC_OPTIONS))), \
+ $(LOCAL_DROIDDOC_OPTIONS))
+remaining_args := $(wordlist $(words $(call pos,--generate-documentation,$(LOCAL_DROIDDOC_OPTIONS))), \
+ $(words $(LOCAL_DROIDDOC_OPTIONS)), $(LOCAL_DROIDDOC_OPTIONS))
+doclava_args := $(wordlist 2, $(words $(remaining_args)), $(remaining_args))
+
+ifneq ($(LOCAL_DROIDDOC_METALAVA_PREVIOUS_API),)
+$(full_target): PRIVATE_DROIDDOC_METALAVA_PREVIOUS_API := --check-compatibility --previous-api $(LOCAL_DROIDDOC_METALAVA_PREVIOUS_API)
+else
+$(full_target): PRIVATE_DROIDDOC_METALAVA_PREVIOUS_API :=
+endif #!LOCAL_DROIDDOC_METALAVA_PREVIOUS_API
+
+metalava_annotations_deps :=
+ifeq ($(strip $(LOCAL_DROIDDOC_METALAVA_ANNOTATIONS_ENABLED)),true)
+ifeq ($(LOCAL_DROIDDOC_METALAVA_PREVIOUS_API),)
+$(error $(LOCAL_PATH): LOCAL_DROIDDOC_METALAVA_PREVIOUS_API has to be non-empty if metalava annotations was enabled!)
+endif
+ifeq ($(LOCAL_DROIDDOC_METALAVA_MERGE_ANNOTATIONS_DIR),)
+$(error $(LOCAL_PATH): LOCAL_DROIDDOC_METALAVA_MERGE_ANNOTATIONS_DIR has to be non-empty if metalava annotations was enabled!)
+endif
+
+$(full_target): PRIVATE_DROIDDOC_METALAVA_ANNOTATIONS := --include-annotations --migrate-nullness \
+ --extract-annotations $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/$(LOCAL_MODULE)_annotations.zip \
+ --merge-annotations $(LOCAL_DROIDDOC_METALAVA_MERGE_ANNOTATIONS_DIR) \
+ --hide HiddenTypedefConstant --hide SuperfluousPrefix --hide AnnotationExtraction
+metalava_annotations_deps := $(sort $(shell find $(LOCAL_DROIDDOC_METALAVA_MERGE_ANNOTATIONS_DIR) -type f))
+else
+$(full_target): PRIVATE_DROIDDOC_METALAVA_ANNOTATIONS :=
+endif #LOCAL_DROIDDOC_METALAVA_ANNOTATIONS_ENABLED=true
+
+$(full_target): \
+ $(full_src_files) $(LOCAL_GENERATED_SOURCES) \
+ $(droiddoc_templates) \
+ $(HOST_JDK_TOOLS_JAR) \
+ $(HOST_OUT_JAVA_LIBRARIES)/jsilver$(COMMON_JAVA_PACKAGE_SUFFIX) \
+ $(HOST_OUT_JAVA_LIBRARIES)/doclava$(COMMON_JAVA_PACKAGE_SUFFIX) \
+ $(HOST_OUT_JAVA_LIBRARIES)/metalava$(COMMON_JAVA_PACKAGE_SUFFIX) \
+ $(html_dir_files) \
+ $(full_java_libs) \
+ $(ZIPSYNC) \
+ $(LOCAL_SRCJARS) \
+ $(LOCAL_ADDITIONAL_DEPENDENCIES) \
+ $(LOCAL_DROIDDOC_METALAVA_PREVIOUS_API) \
+ $(metalava_annotations_deps)
+ @echo metalava based docs: $(PRIVATE_OUT_DIR)
+ $(hide) mkdir -p $(dir $@)
+ $(hide) rm -rf $(PRIVATE_STUB_OUT_DIR)
+ $(call prepare-doc-source-list,$(PRIVATE_SRC_LIST_FILE),$(PRIVATE_JAVA_FILES), \
+ $(PRIVATE_SOURCE_INTERMEDIATES_DIR) $(PRIVATE_ADDITIONAL_JAVA_DIR))
+ $(ZIPSYNC) -d $(PRIVATE_SRCJAR_INTERMEDIATES_DIR) -l $(PRIVATE_SRCJAR_LIST_FILE) -f "*.java" $(PRIVATE_SRCJARS)
+ $(hide) ( \
+ $(JAVA) -jar $(HOST_OUT_JAVA_LIBRARIES)/metalava$(COMMON_JAVA_PACKAGE_SUFFIX) \
+ -encoding UTF-8 -source 1.8 \@$(PRIVATE_SRC_LIST_FILE) \@$(PRIVATE_SRCJAR_LIST_FILE) \
+ $(addprefix -bootclasspath ,$(PRIVATE_BOOTCLASSPATH)) \
+ $(addprefix -classpath ,$(PRIVATE_CLASSPATH)) \
+ --sourcepath $(PRIVATE_SOURCE_PATH) \
+ --no-banner --color --quiet \
+ $(addprefix --stubs ,$(PRIVATE_STUB_OUT_DIR)) \
+ --write-stubs-source-list $(intermediates.COMMON)/stubs-src-list \
+ $(metalava_args) $(PRIVATE_DROIDDOC_METALAVA_PREVIOUS_API) $(PRIVATE_DROIDDOC_METALAVA_ANNOTATIONS) \
+ $(JAVADOC) -encoding UTF-8 -source 1.8 STUBS_SOURCE_LIST \
+ -J-Xmx1600m -J-XX:-OmitStackTraceInFastThrow -XDignore.symbol.file \
+ -quiet -doclet com.google.doclava.Doclava -docletpath $(PRIVATE_DOCLETPATH) \
+ -templatedir $(PRIVATE_CUSTOM_TEMPLATE_DIR) \
+ $(PRIVATE_DROIDDOC_HTML_DIR) $(PRIVATE_ADDITIONAL_HTML_DIR) \
+ $(addprefix -bootclasspath ,$(PRIVATE_BOOTCLASSPATH)) \
+ $(addprefix -classpath ,$(PRIVATE_CLASSPATH)) \
+ -sourcepath $(PRIVATE_SOURCE_PATH) \
+ -d $(PRIVATE_OUT_DIR) \
+ $(PRIVATE_CURRENT_BUILD) $(PRIVATE_CURRENT_TIME) $(doclava_args) \
+ && touch -f $@ ) || (rm -rf $(PRIVATE_OUT_DIR) $(PRIVATE_SRC_LIST_FILE); exit 45)
+
+ifeq ($(strip $(LOCAL_DROIDDOC_METALAVA_ANNOTATIONS_ENABLED)),true)
+$(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/$(LOCAL_MODULE)_annotations.zip: $(full_target)
+endif
+else
+# no docs generation
+$(full_target): \
+ $(full_src_files) $(LOCAL_GENERATED_SOURCES) \
+ $(full_java_libs) \
+ $(HOST_OUT_JAVA_LIBRARIES)/metalava$(COMMON_JAVA_PACKAGE_SUFFIX) \
+ $(ZIPSYNC) \
+ $(LOCAL_SRCJARS) \
+ $(LOCAL_ADDITIONAL_DEPENDENCIES)
+ @echo metalava based stubs: $@
+ $(hide) mkdir -p $(dir $@)
+ $(hide) rm -rf $(PRIVATE_STUB_OUT_DIR)
+ $(call prepare-doc-source-list,$(PRIVATE_SRC_LIST_FILE),$(PRIVATE_JAVA_FILES), \
+ $(PRIVATE_SOURCE_INTERMEDIATES_DIR) $(PRIVATE_ADDITIONAL_JAVA_DIR))
+ $(ZIPSYNC) -d $(PRIVATE_SRCJAR_INTERMEDIATES_DIR) -l $(PRIVATE_SRCJAR_LIST_FILE) -f "*.java" $(PRIVATE_SRCJARS)
+ $(hide) ( \
+ $(JAVA) -jar $(HOST_OUT_JAVA_LIBRARIES)/metalava$(COMMON_JAVA_PACKAGE_SUFFIX) \
+ -encoding UTF-8 -source 1.8 \@$(PRIVATE_SRC_LIST_FILE) \@$(PRIVATE_SRCJAR_LIST_FILE) \
+ $(addprefix -bootclasspath ,$(PRIVATE_BOOTCLASSPATH)) \
+ $(addprefix -classpath ,$(PRIVATE_CLASSPATH)) \
+ --sourcepath $(PRIVATE_SOURCE_PATH) \
+ $(PRIVATE_DROIDDOC_OPTIONS) --no-banner --color --quiet \
+ $(addprefix --stubs ,$(PRIVATE_STUB_OUT_DIR)) \
+ && touch -f $@ ) || (rm -rf $(PRIVATE_SRC_LIST_FILE); exit 45)
+
+endif # stubs + docs generation
+
+else
+
# TODO(tobiast): Clean this up once we move to -source 1.9.
# OpenJDK 9 does not have the concept of a "boot classpath" so we should
# then rename PRIVATE_BOOTCLASSPATH to PRIVATE_MODULE or similar. For now,
# keep -bootclasspath here since it works in combination with -source 1.8.
$(full_target): \
- $(full_src_files) \
- $(LOCAL_GENERATED_SOURCES) \
+ $(full_src_files) $(LOCAL_GENERATED_SOURCES) \
$(droiddoc_templates) \
- $(droiddoc) \
+ $(HOST_JDK_TOOLS_JAR) \
+ $(HOST_OUT_JAVA_LIBRARIES)/jsilver$(COMMON_JAVA_PACKAGE_SUFFIX) \
+ $(HOST_OUT_JAVA_LIBRARIES)/doclava$(COMMON_JAVA_PACKAGE_SUFFIX) \
$(html_dir_files) \
$(full_java_libs) \
$(ZIPSYNC) \
@@ -200,39 +295,25 @@
$(ZIPSYNC) -d $(PRIVATE_SRCJAR_INTERMEDIATES_DIR) -l $(PRIVATE_SRCJAR_LIST_FILE) -f "*.java" $(PRIVATE_SRCJARS)
$(hide) ( \
$(JAVADOC) \
- -encoding UTF-8 \
- -source 1.8 \
- \@$(PRIVATE_SRC_LIST_FILE) \
- \@$(PRIVATE_SRCJAR_LIST_FILE) \
- -J-Xmx1600m \
- -J-XX:-OmitStackTraceInFastThrow \
- -XDignore.symbol.file \
- $(PRIVATE_PROFILING_OPTIONS) \
- -quiet \
- -doclet com.google.doclava.Doclava \
- -docletpath $(PRIVATE_DOCLETPATH) \
+ -encoding UTF-8 -source 1.8 \@$(PRIVATE_SRC_LIST_FILE) \@$(PRIVATE_SRCJAR_LIST_FILE) \
+ -J-Xmx1600m -J-XX:-OmitStackTraceInFastThrow -XDignore.symbol.file \
+ -quiet -doclet com.google.doclava.Doclava -docletpath $(PRIVATE_DOCLETPATH) \
-templatedir $(PRIVATE_CUSTOM_TEMPLATE_DIR) \
- $(PRIVATE_DROIDDOC_HTML_DIR) \
- $(PRIVATE_ADDITIONAL_HTML_DIR) \
+ $(PRIVATE_DROIDDOC_HTML_DIR) $(PRIVATE_ADDITIONAL_HTML_DIR) \
$(addprefix -bootclasspath ,$(PRIVATE_BOOTCLASSPATH)) \
$(addprefix -classpath ,$(PRIVATE_CLASSPATH)) \
-sourcepath $(PRIVATE_SOURCE_PATH)$(addprefix :,$(PRIVATE_CLASSPATH)) \
-d $(PRIVATE_OUT_DIR) \
- $(PRIVATE_CURRENT_BUILD) $(PRIVATE_CURRENT_TIME) \
- $(PRIVATE_DROIDDOC_OPTIONS) \
+ $(PRIVATE_CURRENT_BUILD) $(PRIVATE_CURRENT_TIME) $(PRIVATE_DROIDDOC_OPTIONS) \
$(addprefix -stubs ,$(PRIVATE_STUB_OUT_DIR)) \
- && touch -f $@ \
- ) || (rm -rf $(PRIVATE_OUT_DIR) $(PRIVATE_SRC_LIST_FILE); exit 45)
-
-
+ && touch -f $@ ) || (rm -rf $(PRIVATE_OUT_DIR) $(PRIVATE_SRC_LIST_FILE); exit 45)
+endif #LOCAL_DROIDDOC_USE_METALAVA
else
-##
-##
-## standard doclet only
-##
-##
+###########################################################
+## Logic for javadoc only
+###########################################################
ifdef USE_OPENJDK9
# For OpenJDK 9 we use --patch-module to define the core libraries code.
# TODO(tobiast): Reorganize this when adding proper support for OpenJDK 9
@@ -250,31 +331,15 @@
$(PRIVATE_SOURCE_INTERMEDIATES_DIR) $(PRIVATE_ADDITIONAL_JAVA_DIR))
$(ZIPSYNC) -d $(PRIVATE_SRCJAR_INTERMEDIATES_DIR) -l $(PRIVATE_SRCJAR_LIST_FILE) -f "*.java" $(PRIVATE_SRCJARS)
$(hide) ( \
- $(JAVADOC) \
- -encoding UTF-8 \
- $(PRIVATE_DROIDDOC_OPTIONS) \
- \@$(PRIVATE_SRC_LIST_FILE) \
- \@$(PRIVATE_SRCJAR_LIST_FILE) \
- -J-Xmx1024m \
- -XDignore.symbol.file \
- -Xdoclint:none \
- $(PRIVATE_PROFILING_OPTIONS) \
- $(addprefix -classpath ,$(PRIVATE_CLASSPATH)) \
- $(PRIVATE_BOOTCLASSPATH_ARG) \
- -sourcepath $(PRIVATE_SOURCE_PATH)$(addprefix :,$(PRIVATE_CLASSPATH)) \
+ $(JAVADOC) -encoding UTF-8 \@$(PRIVATE_SRC_LIST_FILE) \@$(PRIVATE_SRCJAR_LIST_FILE) \
+ $(PRIVATE_DROIDDOC_OPTIONS) -J-Xmx1024m -XDignore.symbol.file -Xdoclint:none -quiet \
+ $(addprefix -classpath ,$(PRIVATE_CLASSPATH)) $(PRIVATE_BOOTCLASSPATH_ARG) \
+ -sourcepath $(PRIVATE_SOURCE_PATH) \
-d $(PRIVATE_OUT_DIR) \
- -quiet \
&& touch -f $@ \
) || (rm -rf $(PRIVATE_OUT_DIR) $(PRIVATE_SRC_LIST_FILE); exit 45)
-
-endif
-##
-##
-## Common to both droiddoc and javadoc
-##
-##
-
+endif # !LOCAL_DROIDDOC_USE_STANDARD_DOCLET
ALL_DOCS += $(full_target)
@@ -296,4 +361,4 @@
$(call dist-for-goals,docs,$(out_zip))
-endif
+endif #!LOCAL_UNINSTALLABLE_MODULE
diff --git a/core/envsetup.mk b/core/envsetup.mk
index 12b5869..700189e 100644
--- a/core/envsetup.mk
+++ b/core/envsetup.mk
@@ -663,7 +663,7 @@
TARGET_OUT_PRODUCT := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_PRODUCT)
ifneq ($(filter address,$(SANITIZE_TARGET)),)
-target_out_product_shared_libraries_base := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_ASAN)/system
+target_out_product_shared_libraries_base := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_ASAN)/product
ifeq ($(SANITIZE_LITE),true)
# When using SANITIZE_LITE, APKs must not be packaged with sanitized libraries, as they will not
# work with unsanitized app_process. For simplicity, generate APKs into /data/asan/.
@@ -672,7 +672,7 @@
target_out_product_app_base := $(TARGET_OUT_PRODUCT)
endif
else
-target_out_product_shared_libraries_base := $(TARGET_OUT)
+target_out_product_shared_libraries_base := $(TARGET_OUT_PRODUCT)
target_out_product_app_base := $(TARGET_OUT_PRODUCT)
endif
diff --git a/core/main.mk b/core/main.mk
index 033a2d9..1946edb 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -96,6 +96,8 @@
-include tools/tradefederation/build/suites/general-tests/config.mk
# STS-specific config.
-include test/sts/tools/sts-tradefed/build/config.mk
+# CTS-Instant-specific config
+-include test/suite_harness/tools/cts-instant-tradefed/build/config.mk
# Clean rules
.PHONY: clean-dex-files
diff --git a/core/package_internal.mk b/core/package_internal.mk
index fc2026c..80d386d 100644
--- a/core/package_internal.mk
+++ b/core/package_internal.mk
@@ -414,7 +414,7 @@
$(resource_export_package): PRIVATE_PRODUCT_AAPT_CONFIG :=
$(resource_export_package): PRIVATE_PRODUCT_AAPT_PREF_CONFIG :=
$(resource_export_package): PRIVATE_RESOURCE_LIST := $(all_res_assets)
- $(resource_export_package): $(all_res_assets) $(full_android_manifest) $(RenderScript_file_stamp) $(AAPT)
+ $(resource_export_package): $(all_res_assets) $(full_android_manifest) $(rs_generated_res_zip) $(AAPT)
@echo "target Export Resources: $(PRIVATE_MODULE) ($@)"
$(create-empty-package)
$(add-assets-to-package)
diff --git a/core/tasks/cts_instant.mk b/core/tasks/cts_instant.mk
new file mode 100644
index 0000000..18f1db3
--- /dev/null
+++ b/core/tasks/cts_instant.mk
@@ -0,0 +1,25 @@
+# Copyright (C) 2018 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+test_suite_name := cts_instant
+test_suite_tradefed := cts-instant-tradefed
+test_suite_dynamic_config := test/suite_harness/tools/cts-instant-tradefed/DynamicConfig.xml
+test_suite_readme := test/suite_harness/tools/cts-instant-tradefed/README
+
+include $(BUILD_SYSTEM)/tasks/tools/compatibility.mk
+
+.PHONY: cts_instant
+cts_instant: $(compatibility_zip)
+$(call dist-for-goals, cts_instant, $(compatibility_zip))
+
diff --git a/core/tasks/sdk-addon.mk b/core/tasks/sdk-addon.mk
index 197d41a..2a20f07 100644
--- a/core/tasks/sdk-addon.mk
+++ b/core/tasks/sdk-addon.mk
@@ -65,7 +65,6 @@
files_to_copy += \
$(addon_dir_img):$(INSTALLED_QEMU_SYSTEMIMAGE):images/$(TARGET_CPU_ABI)/system.img \
$(addon_dir_img):$(INSTALLED_QEMU_VENDORIMAGE):images/$(TARGET_CPU_ABI)/vendor.img \
- $(addon_dir_img):$(BUILT_USERDATAIMAGE_TARGET):images/$(TARGET_CPU_ABI)/userdata.img \
$(addon_dir_img):$(BUILT_RAMDISK_TARGET):images/$(TARGET_CPU_ABI)/ramdisk.img \
$(addon_dir_img):$(PRODUCT_OUT)/system/build.prop:images/$(TARGET_CPU_ABI)/build.prop \
$(addon_dir_img):$(target_notice_file_txt):images/$(TARGET_CPU_ABI)/NOTICE.txt \
diff --git a/core/tasks/vendor_module_check.mk b/core/tasks/vendor_module_check.mk
index ae967c6..6695994 100644
--- a/core/tasks/vendor_module_check.mk
+++ b/core/tasks/vendor_module_check.mk
@@ -44,6 +44,7 @@
ti \
trusted_logic \
verizon \
+ waves \
widevine
diff --git a/core/tasks/vndk.mk b/core/tasks/vndk.mk
index 3604aed..b9133df 100644
--- a/core/tasks/vndk.mk
+++ b/core/tasks/vndk.mk
@@ -141,9 +141,13 @@
#######################################
# vndk_snapshot_zip
vndk_snapshot_variant := $(vndk_snapshot_out)/$(TARGET_ARCH)
-vndk_lib_dir := $(vndk_snapshot_variant)/arch-$(TARGET_ARCH)-$(TARGET_ARCH_VARIANT)
-vndk_lib_dir_2nd := $(vndk_snapshot_variant)/arch-$(TARGET_2ND_ARCH)-$(TARGET_2ND_ARCH_VARIANT)
-vndk_snapshot_zip := $(PRODUCT_OUT)/android-vndk-$(TARGET_ARCH).zip
+binder :=
+ifneq ($(TARGET_USES_64_BIT_BINDER), true)
+ binder := binder32
+endif
+vndk_lib_dir := $(subst $(space),/,$(strip $(vndk_snapshot_variant) $(binder) arch-$(TARGET_ARCH)-$(TARGET_ARCH_VARIANT)))
+vndk_lib_dir_2nd := $(subst $(space),/,$(strip $(vndk_snapshot_variant) $(binder) arch-$(TARGET_2ND_ARCH)-$(TARGET_2ND_ARCH_VARIANT)))
+vndk_snapshot_zip := $(PRODUCT_OUT)/android-vndk-$(TARGET_PRODUCT).zip
$(vndk_snapshot_zip): PRIVATE_VNDK_SNAPSHOT_OUT := $(vndk_snapshot_out)
@@ -233,6 +237,7 @@
vndk_snapshot_out :=
vndk_snapshot_configs_out :=
vndk_snapshot_variant :=
+binder :=
vndk_lib_dir :=
vndk_lib_dir_2nd :=
vndk_snapshot_dependencies :=
diff --git a/core/version_defaults.mk b/core/version_defaults.mk
index f555ab5..6c5eac2 100644
--- a/core/version_defaults.mk
+++ b/core/version_defaults.mk
@@ -231,9 +231,19 @@
# It must be of the form "YYYY-MM-DD" on production devices.
# It must match one of the Android Security Patch Level strings of the Public Security Bulletins.
# If there is no $PLATFORM_SECURITY_PATCH set, keep it empty.
- PLATFORM_SECURITY_PATCH := 2018-05-05
+ PLATFORM_SECURITY_PATCH := 2018-07-05
endif
+ifndef PLATFORM_SECURITY_PATCH_TIMESTAMP
+ # Used to indicate the matching timestamp for the security patch string in PLATFORM_SECURITY_PATCH.
+ ifneq (,$(findstring Darwin,$(UNAME)))
+ PLATFORM_SECURITY_PATCH_TIMESTAMP := $(shell date -jf '%Y-%m-%d %T %Z' '$(PLATFORM_SECURITY_PATCH) 00:00:00 GMT' +%s)
+ else
+ PLATFORM_SECURITY_PATCH_TIMESTAMP := $(shell date -d 'TZ="GMT" $(PLATFORM_SECURITY_PATCH)' +%s)
+ endif
+endif
+.KATI_READONLY := PLATFORM_SECURITY_PATCH_TIMESTAMP
+
ifndef PLATFORM_BASE_OS
# Used to indicate the base os applied to the device.
# Can be an arbitrary string, but must be a single word.
diff --git a/target/board/generic/BoardConfig.mk b/target/board/generic/BoardConfig.mk
index c76339f..009fb32 100644
--- a/target/board/generic/BoardConfig.mk
+++ b/target/board/generic/BoardConfig.mk
@@ -8,18 +8,31 @@
TARGET_NO_KERNEL := true
TARGET_ARCH := arm
-# Note: we build the platform images for ARMv7-A _without_ NEON.
+# Note: Before Pi, we built the platform images for ARMv7-A _without_ NEON.
#
-# Technically, the emulator supports ARMv7-A _and_ NEON instructions, but
-# emulated NEON code paths typically ends up 2x slower than the normal C code
-# it is supposed to replace (unlike on real devices where it is 2x to 3x
-# faster).
+ifneq ($(TARGET_BUILD_APPS)$(filter cts sdk,$(MAKECMDGOALS)),)
+# DO NOT USE
#
-# What this means is that the platform image will not use NEON code paths
-# that are slower to emulate. On the other hand, it is possible to emulate
-# application code generated with the NDK that uses NEON in the emulator.
+# This architecture variant should NOT be used for 32 bit arm platform
+# builds. It is the lowest common denominator required to build
+# an unbundled application for all supported 32 platforms.
+# cts for 32 bit arm is built using aosp_arm64 product.
#
+# If you are building a 32 bit platform (and not an application),
+# you should set the following as 2nd arch variant:
+#
+# TARGET_ARCH_VARIANT := armv7-a-neon
+#
+# DO NOT USE
TARGET_ARCH_VARIANT := armv7-a
+# DO NOT USE
+else
+# Starting from Pi, System image of aosp_arm products is the new GSI
+# for real devices newly launched for Pi. These devices are usualy not
+# as performant as the mainstream 64-bit devices and the performance
+# provided by NEON is important for them to pass related CTS tests.
+TARGET_ARCH_VARIANT := armv7-a-neon
+endif
TARGET_CPU_VARIANT := generic
TARGET_CPU_ABI := armeabi-v7a
TARGET_CPU_ABI2 := armeabi
@@ -56,6 +69,9 @@
TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true
DEVICE_MATRIX_FILE := device/generic/goldfish/compatibility_matrix.xml
+# Android generic system image always create metadata partition
+BOARD_USES_METADATA_PARTITION := true
+
# Set this to create /cache mount point for non-A/B devices that mounts /cache.
# The partition size doesn't matter, just to make build pass.
BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4
diff --git a/target/board/generic/device.mk b/target/board/generic/device.mk
index d2f6310..82c6657 100644
--- a/target/board/generic/device.mk
+++ b/target/board/generic/device.mk
@@ -17,12 +17,7 @@
# This is a build configuration for the product aspects that
# are specific to the emulator.
-PRODUCT_PROPERTY_OVERRIDES := \
- ro.ril.hsxpa=1 \
- ro.ril.gprsclass=10
-
PRODUCT_COPY_FILES := \
- device/generic/goldfish/data/etc/apns-conf.xml:system/etc/apns-conf.xml \
device/generic/goldfish/camera/media_profiles.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_profiles.xml \
frameworks/av/media/libstagefright/data/media_codecs_google_audio.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_audio.xml \
frameworks/av/media/libstagefright/data/media_codecs_google_telephony.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_telephony.xml \
diff --git a/target/board/generic/sepolicy/bootanim.te b/target/board/generic/sepolicy/bootanim.te
index e4f7c73..bc84ee7 100644
--- a/target/board/generic/sepolicy/bootanim.te
+++ b/target/board/generic/sepolicy/bootanim.te
@@ -5,4 +5,5 @@
allow bootanim graphics_device:chr_file { read ioctl open };
+typeattribute bootanim system_writes_vendor_properties_violators;
set_prop(bootanim, qemu_prop)
diff --git a/target/board/generic/sepolicy/goldfish_setup.te b/target/board/generic/sepolicy/goldfish_setup.te
index a99653c..3041436 100644
--- a/target/board/generic/sepolicy/goldfish_setup.te
+++ b/target/board/generic/sepolicy/goldfish_setup.te
@@ -25,10 +25,11 @@
allow goldfish_setup execns_exec:file rx_file_perms;
allow goldfish_setup proc_net:file rw_file_perms;
allow goldfish_setup proc:file r_file_perms;
-set_prop(goldfish_setup, ctl_default_prop);
allow goldfish_setup nsfs:file r_file_perms;
allow goldfish_setup system_data_file:dir getattr;
allow goldfish_setup kernel:system module_request;
+set_prop(goldfish_setup, qemu_prop);
+get_prop(goldfish_setup, net_share_prop);
# Allow goldfish_setup to run /system/bin/ip and /system/bin/iw
allow goldfish_setup system_file:file execute_no_trans;
# Allow goldfish_setup to run init.wifi.sh
diff --git a/target/board/generic/sepolicy/property.te b/target/board/generic/sepolicy/property.te
index 8c7c892..3593a39 100644
--- a/target/board/generic/sepolicy/property.te
+++ b/target/board/generic/sepolicy/property.te
@@ -2,3 +2,4 @@
type qemu_cmdline, property_type;
type radio_noril_prop, property_type;
type net_eth0_prop, property_type;
+type net_share_prop, property_type;
diff --git a/target/board/generic/sepolicy/property_contexts b/target/board/generic/sepolicy/property_contexts
index c5a2bc1..f7a241c 100644
--- a/target/board/generic/sepolicy/property_contexts
+++ b/target/board/generic/sepolicy/property_contexts
@@ -1,6 +1,8 @@
qemu. u:object_r:qemu_prop:s0
qemu.cmdline u:object_r:qemu_cmdline:s0
+vendor.qemu u:object_r:qemu_prop:s0
ro.emu. u:object_r:qemu_prop:s0
ro.emulator. u:object_r:qemu_prop:s0
ro.radio.noril u:object_r:radio_noril_prop:s0
net.eth0. u:object_r:net_eth0_prop:s0
+net.shared_net_ip u:object_r:net_share_prop:s0
diff --git a/target/board/generic/sepolicy/surfaceflinger.te b/target/board/generic/sepolicy/surfaceflinger.te
index e03d07e..2bba8a7 100644
--- a/target/board/generic/sepolicy/surfaceflinger.te
+++ b/target/board/generic/sepolicy/surfaceflinger.te
@@ -1,4 +1,5 @@
allow surfaceflinger self:process execmem;
allow surfaceflinger ashmem_device:chr_file execute;
+typeattribute surfaceflinger system_writes_vendor_properties_violators;
set_prop(surfaceflinger, qemu_prop)
diff --git a/target/board/generic/sepolicy/zygote.te b/target/board/generic/sepolicy/zygote.te
index e97d895..da403b5 100644
--- a/target/board/generic/sepolicy/zygote.te
+++ b/target/board/generic/sepolicy/zygote.te
@@ -1,3 +1,4 @@
+typeattribute zygote system_writes_vendor_properties_violators;
set_prop(zygote, qemu_prop)
# TODO (b/63631799) fix this access
# Suppress denials to storage. Webview zygote should not be accessing.
diff --git a/target/board/generic_arm64/BoardConfig.mk b/target/board/generic_arm64/BoardConfig.mk
index 0a65d55..d4a8553 100644
--- a/target/board/generic_arm64/BoardConfig.mk
+++ b/target/board/generic_arm64/BoardConfig.mk
@@ -85,6 +85,9 @@
TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true
DEVICE_MATRIX_FILE := device/generic/goldfish/compatibility_matrix.xml
+# Android generic system image always create metadata partition
+BOARD_USES_METADATA_PARTITION := true
+
# Set this to create /cache mount point for non-A/B devices that mounts /cache.
# The partition size doesn't matter, just to make build pass.
BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4
diff --git a/target/board/generic_arm64/device.mk b/target/board/generic_arm64/device.mk
index 8d62f4b..c0fbdcd 100644
--- a/target/board/generic_arm64/device.mk
+++ b/target/board/generic_arm64/device.mk
@@ -17,12 +17,7 @@
# This is a build configuration for the product aspects that
# are specific to the emulator.
-PRODUCT_PROPERTY_OVERRIDES := \
- ro.ril.hsxpa=1 \
- ro.ril.gprsclass=10
-
PRODUCT_COPY_FILES := \
- device/generic/goldfish/data/etc/apns-conf.xml:system/etc/apns-conf.xml \
device/generic/goldfish/camera/media_profiles.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_profiles.xml \
frameworks/av/media/libstagefright/data/media_codecs_google_audio.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_audio.xml \
frameworks/av/media/libstagefright/data/media_codecs_google_telephony.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_telephony.xml \
diff --git a/target/board/generic_x86/BoardConfig.mk b/target/board/generic_x86/BoardConfig.mk
index 0721a71..5af7e5a 100644
--- a/target/board/generic_x86/BoardConfig.mk
+++ b/target/board/generic_x86/BoardConfig.mk
@@ -58,6 +58,9 @@
TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true
DEVICE_MATRIX_FILE := device/generic/goldfish/compatibility_matrix.xml
+# Android generic system image always create metadata partition
+BOARD_USES_METADATA_PARTITION := true
+
# Set this to create /cache mount point for non-A/B devices that mounts /cache.
# The partition size doesn't matter, just to make build pass.
BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4
diff --git a/target/board/generic_x86/device.mk b/target/board/generic_x86/device.mk
index 7b6fa3c..ecf8697 100644
--- a/target/board/generic_x86/device.mk
+++ b/target/board/generic_x86/device.mk
@@ -17,12 +17,7 @@
# This is a build configuration for the product aspects that
# are specific to the emulator.
-PRODUCT_PROPERTY_OVERRIDES := \
- ro.ril.hsxpa=1 \
- ro.ril.gprsclass=10
-
PRODUCT_COPY_FILES := \
- device/generic/goldfish/data/etc/apns-conf.xml:system/etc/apns-conf.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 \
diff --git a/target/board/generic_x86_64/BoardConfig.mk b/target/board/generic_x86_64/BoardConfig.mk
index e2f8f47..81e325e 100755
--- a/target/board/generic_x86_64/BoardConfig.mk
+++ b/target/board/generic_x86_64/BoardConfig.mk
@@ -56,6 +56,9 @@
BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true
DEVICE_MATRIX_FILE := device/generic/goldfish/compatibility_matrix.xml
+# Android generic system image always create metadata partition
+BOARD_USES_METADATA_PARTITION := true
+
# Set this to create /cache mount point for non-A/B devices that mounts /cache.
# The partition size doesn't matter, just to make build pass.
BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4
diff --git a/target/board/generic_x86_64/device.mk b/target/board/generic_x86_64/device.mk
index 7b6fa3c..ecf8697 100755
--- a/target/board/generic_x86_64/device.mk
+++ b/target/board/generic_x86_64/device.mk
@@ -17,12 +17,7 @@
# This is a build configuration for the product aspects that
# are specific to the emulator.
-PRODUCT_PROPERTY_OVERRIDES := \
- ro.ril.hsxpa=1 \
- ro.ril.gprsclass=10
-
PRODUCT_COPY_FILES := \
- device/generic/goldfish/data/etc/apns-conf.xml:system/etc/apns-conf.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 \
diff --git a/target/board/treble_common.mk b/target/board/treble_common.mk
index bf07e28..c4e68fe 100644
--- a/target/board/treble_common.mk
+++ b/target/board/treble_common.mk
@@ -39,6 +39,9 @@
# Generic AOSP image always requires separate vendor.img
TARGET_COPY_OUT_VENDOR := vendor
+# Android generic system image always create metadata partition
+BOARD_USES_METADATA_PARTITION := true
+
# Generic AOSP image does NOT support HWC1
TARGET_USES_HWC2 := true
# Set emulator framebuffer display device buffer count to 3
diff --git a/target/product/aosp_arm.mk b/target/product/aosp_arm.mk
index b59f3cc..bda9a42 100644
--- a/target/product/aosp_arm.mk
+++ b/target/product/aosp_arm.mk
@@ -15,7 +15,7 @@
#
PRODUCT_PROPERTY_OVERRIDES += \
- rild.libpath=/vendor/lib/libreference-ril.so
+ vendor.rild.libpath=/vendor/lib/libreference-ril.so
# Note: the following lines need to stay at the beginning so that it can
# take priority and override the rules it inherit from other mk files
diff --git a/target/product/aosp_arm64.mk b/target/product/aosp_arm64.mk
index 650c391..727762a 100644
--- a/target/product/aosp_arm64.mk
+++ b/target/product/aosp_arm64.mk
@@ -15,7 +15,7 @@
#
PRODUCT_PROPERTY_OVERRIDES += \
- rild.libpath=/vendor/lib64/libreference-ril.so
+ vendor.rild.libpath=/vendor/lib64/libreference-ril.so
# 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
@@ -42,12 +42,11 @@
PRODUCT_PACKAGES += \
vr_hwc
+$(call inherit-product, $(SRC_TARGET_DIR)/product/emulator.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/board/generic_arm64/device.mk)
-include $(SRC_TARGET_DIR)/product/emulator.mk
-
# Needed by Pi newly launched device to pass VtsTrebleSysProp on GSI
PRODUCT_COMPATIBLE_PROPERTY_OVERRIDE := true
diff --git a/target/product/aosp_arm64_ab.mk b/target/product/aosp_arm64_ab.mk
index c96cb91..6ff1157 100644
--- a/target/product/aosp_arm64_ab.mk
+++ b/target/product/aosp_arm64_ab.mk
@@ -21,12 +21,6 @@
include build/make/target/product/treble_common_64.mk
-AB_OTA_UPDATER := true
-AB_OTA_PARTITIONS := system
-PRODUCT_PACKAGES += \
- update_engine \
- update_verifier
-
PRODUCT_NAME := aosp_arm64_ab
PRODUCT_DEVICE := generic_arm64_ab
PRODUCT_BRAND := Android
diff --git a/target/product/aosp_arm_ab.mk b/target/product/aosp_arm_ab.mk
index 98b2f99..9a4688e 100644
--- a/target/product/aosp_arm_ab.mk
+++ b/target/product/aosp_arm_ab.mk
@@ -21,12 +21,6 @@
include build/make/target/product/treble_common_32.mk
-AB_OTA_UPDATER := true
-AB_OTA_PARTITIONS := system
-PRODUCT_PACKAGES += \
- update_engine \
- update_verifier
-
PRODUCT_NAME := aosp_arm_ab
PRODUCT_DEVICE := generic_arm_ab
PRODUCT_BRAND := Android
diff --git a/target/product/aosp_x86.mk b/target/product/aosp_x86.mk
index 315a099..cd099e7 100644
--- a/target/product/aosp_x86.mk
+++ b/target/product/aosp_x86.mk
@@ -15,7 +15,7 @@
#
PRODUCT_PROPERTY_OVERRIDES += \
- rild.libpath=/vendor/lib/libreference-ril.so
+ vendor.rild.libpath=/vendor/lib/libreference-ril.so
# 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
diff --git a/target/product/aosp_x86_64.mk b/target/product/aosp_x86_64.mk
index 7ca1c71..3686009 100644
--- a/target/product/aosp_x86_64.mk
+++ b/target/product/aosp_x86_64.mk
@@ -15,7 +15,7 @@
#
PRODUCT_PROPERTY_OVERRIDES += \
- rild.libpath=/vendor/lib64/libreference-ril.so
+ vendor.rild.libpath=/vendor/lib64/libreference-ril.so
# 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
@@ -39,12 +39,11 @@
PRODUCT_PACKAGES += \
vr_hwc
+$(call inherit-product, $(SRC_TARGET_DIR)/product/emulator.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/board/generic_x86_64/device.mk)
-include $(SRC_TARGET_DIR)/product/emulator.mk
-
# Needed by Pi newly launched device to pass VtsTrebleSysProp on GSI
PRODUCT_COMPATIBLE_PROPERTY_OVERRIDE := true
diff --git a/target/product/aosp_x86_64_ab.mk b/target/product/aosp_x86_64_ab.mk
index 4590dc5..3524dbc 100644
--- a/target/product/aosp_x86_64_ab.mk
+++ b/target/product/aosp_x86_64_ab.mk
@@ -21,12 +21,6 @@
include build/make/target/product/treble_common_64.mk
-AB_OTA_UPDATER := true
-AB_OTA_PARTITIONS := system
-PRODUCT_PACKAGES += \
- update_engine \
- update_verifier
-
PRODUCT_NAME := aosp_x86_64_ab
PRODUCT_DEVICE := generic_x86_64_ab
PRODUCT_BRAND := Android
diff --git a/target/product/aosp_x86_ab.mk b/target/product/aosp_x86_ab.mk
index 404a4da..e72b38d 100644
--- a/target/product/aosp_x86_ab.mk
+++ b/target/product/aosp_x86_ab.mk
@@ -21,12 +21,6 @@
include build/make/target/product/treble_common_32.mk
-AB_OTA_UPDATER := true
-AB_OTA_PARTITIONS := system
-PRODUCT_PACKAGES += \
- update_engine \
- update_verifier
-
PRODUCT_NAME := aosp_x86_ab
PRODUCT_DEVICE := generic_x86_ab
PRODUCT_BRAND := Android
diff --git a/target/product/core.mk b/target/product/core.mk
index acbc87f..c72bb2f 100644
--- a/target/product/core.mk
+++ b/target/product/core.mk
@@ -42,7 +42,7 @@
KeyChain \
Keyguard \
LatinIME \
- Launcher3 \
+ Launcher3QuickStep \
ManagedProvisioning \
MtpDocumentsProvider \
PacProcessor \
diff --git a/target/product/core_minimal.mk b/target/product/core_minimal.mk
index 1849818..85646c1 100644
--- a/target/product/core_minimal.mk
+++ b/target/product/core_minimal.mk
@@ -33,6 +33,7 @@
HTMLViewer \
MediaProvider \
PackageInstaller \
+ SecureElement \
SettingsProvider \
Shell \
StatementService \
@@ -177,3 +178,7 @@
$(call inherit-product, $(SRC_TARGET_DIR)/product/runtime_libart.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/base.mk)
+
+# Enable CFI for security-sensitive components
+$(call inherit-product, $(SRC_TARGET_DIR)/product/cfi-common.mk)
+$(call inherit-product-if-exists, vendor/google/products/cfi-vendor.mk)
diff --git a/target/product/core_tiny.mk b/target/product/core_tiny.mk
index 48a044b..4ef7b48 100644
--- a/target/product/core_tiny.mk
+++ b/target/product/core_tiny.mk
@@ -41,6 +41,7 @@
DefaultContainerService \
ExtShared \
ExtServices \
+ SecureElement \
SettingsProvider \
Shell \
WallpaperBackup \
diff --git a/target/product/embedded.mk b/target/product/embedded.mk
index 6ddc07e..69cf102 100644
--- a/target/product/embedded.mk
+++ b/target/product/embedded.mk
@@ -21,7 +21,7 @@
adb \
adbd \
usbd \
- android.hardware.configstore@1.0-service \
+ android.hardware.configstore@1.1-service \
android.hidl.allocator@1.0-service \
android.hidl.memory@1.0-impl \
android.hidl.memory@1.0-impl.vendor \
diff --git a/target/product/emulator.mk b/target/product/emulator.mk
index 8e100be..78d8e92 100644
--- a/target/product/emulator.mk
+++ b/target/product/emulator.mk
@@ -70,11 +70,16 @@
sh_vendor \
vintf \
toybox_vendor \
- CarrierConfig
+ CarrierConfig \
+ audio.primary.goldfish \
+ audio.r_submix.default \
+ local_time.default \
+ SdkSetup
PRODUCT_PACKAGES += \
android.hardware.audio@2.0-impl \
android.hardware.audio.effect@2.0-impl \
+ android.hardware.broadcastradio@1.1-service \
android.hardware.broadcastradio@1.0-impl \
android.hardware.soundtrigger@2.0-impl
@@ -129,6 +134,7 @@
wpa_supplicant \
PRODUCT_COPY_FILES += \
+ device/generic/goldfish/data/etc/apns-conf.xml:data/misc/apns/apns-conf.xml \
device/generic/goldfish/init.ranchu-core.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.ranchu-core.sh \
device/generic/goldfish/init.ranchu-net.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.ranchu-net.sh \
device/generic/goldfish/wifi/init.wifi.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.wifi.sh \
@@ -142,7 +148,22 @@
device/generic/goldfish/wifi/simulated_hostapd.conf:$(TARGET_COPY_OUT_VENDOR)/etc/simulated_hostapd.conf \
device/generic/goldfish/wifi/wpa_supplicant.conf:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/wpa_supplicant.conf \
device/generic/goldfish/wifi/WifiConfigStore.xml:data/misc/wifi/WifiConfigStore.xml \
- frameworks/native/data/etc/android.hardware.wifi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.xml
+ frameworks/native/data/etc/android.hardware.wifi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.xml \
+ device/generic/goldfish/data/etc/handheld_core_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/handheld_core_hardware.xml \
+ device/generic/goldfish/camera/media_profiles.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_profiles_V1_0.xml \
+ frameworks/av/media/libstagefright/data/media_codecs_google_audio.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_audio.xml \
+ frameworks/av/media/libstagefright/data/media_codecs_google_telephony.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_telephony.xml \
+ device/generic/goldfish/camera/media_codecs_google_video.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_video.xml \
+ device/generic/goldfish/camera/media_codecs.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs.xml \
+ device/generic/goldfish/camera/media_codecs_performance.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_performance.xml \
+ frameworks/native/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml \
+ frameworks/native/data/etc/android.hardware.camera.autofocus.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.autofocus.xml \
+ frameworks/native/data/etc/android.hardware.camera.full.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.full.xml \
+ frameworks/native/data/etc/android.hardware.fingerprint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.fingerprint.xml \
+ frameworks/native/data/etc/android.software.autofill.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.autofill.xml \
+ frameworks/av/media/libeffects/data/audio_effects.conf:$(TARGET_COPY_OUT_VENDOR)/etc/audio_effects.conf \
+ device/generic/goldfish/audio_policy.conf:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy.conf
+
PRODUCT_PACKAGE_OVERLAYS := device/generic/goldfish/overlay
@@ -156,3 +177,16 @@
#once it is fixed in aosp, remove this block of comment.
#PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \
#config.disable_location=true
+
+# Enable Perfetto traced
+PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
+ persist.traced.enable=1
+
+# enable Google-specific location features,
+# like NetworkLocationProvider and LocationCollector
+PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
+ ro.com.google.locationfeatures=1
+
+# disable setupwizard
+PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
+ ro.setupwizard.mode=DISABLED
diff --git a/target/product/full.mk b/target/product/full.mk
index b66ae92..7c0578c 100644
--- a/target/product/full.mk
+++ b/target/product/full.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/emulator.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/board/generic/device.mk)
-include $(SRC_TARGET_DIR)/product/emulator.mk
-
# Overrides
PRODUCT_NAME := full
PRODUCT_DEVICE := generic
diff --git a/target/product/full_x86.mk b/target/product/full_x86.mk
index 4dff713..6ea2d05 100644
--- a/target/product/full_x86.mk
+++ b/target/product/full_x86.mk
@@ -23,11 +23,10 @@
# that isn't a wifi connection. This will instruct init.rc to enable the
# network connection so that you can use it with ADB
+$(call inherit-product, $(SRC_TARGET_DIR)/product/emulator.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/board/generic_x86/device.mk)
-include $(SRC_TARGET_DIR)/product/emulator.mk
-
ifdef NET_ETH0_STARTONBOOT
PRODUCT_PROPERTY_OVERRIDES += net.eth0.startonboot=1
endif
diff --git a/target/product/sdk_base.mk b/target/product/sdk_base.mk
index c50d653..1e5ed19 100644
--- a/target/product/sdk_base.mk
+++ b/target/product/sdk_base.mk
@@ -23,7 +23,7 @@
Development \
Dialer \
Gallery2 \
- Launcher3 \
+ Launcher3QuickStep \
Camera2 \
librs_jni \
LiveWallpapersPicker \
diff --git a/target/product/sdk_phone_x86.mk b/target/product/sdk_phone_x86.mk
index 9bbf9b4..b34e5b6 100644
--- a/target/product/sdk_phone_x86.mk
+++ b/target/product/sdk_phone_x86.mk
@@ -14,25 +14,11 @@
# limitations under the License.
#
-PRODUCT_PROPERTY_OVERRIDES += \
- rild.libpath=/vendor/lib/libreference-ril.so
+$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_x86.mk)
-# 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.
-PRODUCT_COPY_FILES += \
- development/sys-img/advancedFeatures.ini:advancedFeatures.ini \
- device/generic/goldfish/data/etc/encryptionkey.img:encryptionkey.img \
- prebuilts/qemu-kernel/x86_64/4.9/kernel-qemu2:kernel-ranchu-64
-
-$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk_base.mk)
-
-# AOSP emulator images build the AOSP messaging app.
-# Google API images override with the Google API app.
-# See vendor/google/products/sdk_google_phone_*.mk
-PRODUCT_PACKAGES += \
- messaging
+# Define the host tools and libs that are parts of the SDK.
+-include sdk/build/product_sdk.mk
+-include development/build/product_sdk.mk
# Overrides
PRODUCT_BRAND := Android
diff --git a/target/product/sdk_phone_x86_64.mk b/target/product/sdk_phone_x86_64.mk
index 25b0d03..37c078e 100644
--- a/target/product/sdk_phone_x86_64.mk
+++ b/target/product/sdk_phone_x86_64.mk
@@ -14,27 +14,11 @@
# limitations under the License.
#
-PRODUCT_PROPERTY_OVERRIDES += \
- rild.libpath=/vendor/lib64/libreference-ril.so
+$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_x86_64.mk)
-# 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.
-
-PRODUCT_COPY_FILES += \
- development/sys-img/advancedFeatures.ini:advancedFeatures.ini \
- device/generic/goldfish/data/etc/encryptionkey.img:encryptionkey.img \
- prebuilts/qemu-kernel/x86_64/4.9/kernel-qemu2:kernel-ranchu
-
-$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
-$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk_base.mk)
-
-# AOSP emulator images build the AOSP messaging app.
-# Google API images override with the Google API app.
-# See vendor/google/products/sdk_google_phone_*.mk
-PRODUCT_PACKAGES += \
- messaging
+# Define the host tools and libs that are parts of the SDK.
+-include sdk/build/product_sdk.mk
+-include development/build/product_sdk.mk
# Overrides
PRODUCT_BRAND := Android
diff --git a/target/product/vndk/28.txt b/target/product/vndk/28.txt
index 38241f5..712e91c 100644
--- a/target/product/vndk/28.txt
+++ b/target/product/vndk/28.txt
@@ -82,6 +82,7 @@
VNDK-core: android.hardware.cas@1.0.so
VNDK-core: android.hardware.configstore-utils.so
VNDK-core: android.hardware.configstore@1.0.so
+VNDK-core: android.hardware.configstore@1.1.so
VNDK-core: android.hardware.confirmationui-support-lib.so
VNDK-core: android.hardware.confirmationui@1.0.so
VNDK-core: android.hardware.contexthub@1.0.so
diff --git a/target/product/vndk/current.txt b/target/product/vndk/current.txt
index 38241f5..712e91c 100644
--- a/target/product/vndk/current.txt
+++ b/target/product/vndk/current.txt
@@ -82,6 +82,7 @@
VNDK-core: android.hardware.cas@1.0.so
VNDK-core: android.hardware.configstore-utils.so
VNDK-core: android.hardware.configstore@1.0.so
+VNDK-core: android.hardware.configstore@1.1.so
VNDK-core: android.hardware.confirmationui-support-lib.so
VNDK-core: android.hardware.confirmationui@1.0.so
VNDK-core: android.hardware.contexthub@1.0.so
diff --git a/tools/fs_config/Android.mk b/tools/fs_config/Android.mk
index f946303..a01e702 100644
--- a/tools/fs_config/Android.mk
+++ b/tools/fs_config/Android.mk
@@ -254,7 +254,7 @@
include $(BUILD_HEADER_LIBRARY)
##################################
-# Generate the system/etc/passwd text file for the target
+# Generate the vendor/etc/passwd text file for the target
# This file may be empty if no AIDs are defined in
# TARGET_FS_CONFIG_GEN files.
include $(CLEAR_VARS)
@@ -270,10 +270,10 @@
$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config)
$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config)
@mkdir -p $(dir $@)
- $(hide) $< passwd --aid-header=$(PRIVATE_ANDROID_FS_HDR) $(PRIVATE_TARGET_FS_CONFIG_GEN) > $@
+ $(hide) $< passwd --required-prefix=vendor_ --aid-header=$(PRIVATE_ANDROID_FS_HDR) $(PRIVATE_TARGET_FS_CONFIG_GEN) > $@
##################################
-# Generate the system/etc/group text file for the target
+# Generate the vendor/etc/group text file for the target
# This file may be empty if no AIDs are defined in
# TARGET_FS_CONFIG_GEN files.
include $(CLEAR_VARS)
@@ -289,7 +289,7 @@
$(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config)
$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config)
@mkdir -p $(dir $@)
- $(hide) $< group --aid-header=$(PRIVATE_ANDROID_FS_HDR) $(PRIVATE_TARGET_FS_CONFIG_GEN) > $@
+ $(hide) $< group --required-prefix=vendor_ --aid-header=$(PRIVATE_ANDROID_FS_HDR) $(PRIVATE_TARGET_FS_CONFIG_GEN) > $@
system_android_filesystem_config :=
endif
diff --git a/tools/fs_config/fs_config_generator.py b/tools/fs_config/fs_config_generator.py
index d51d075..4839578 100755
--- a/tools/fs_config/fs_config_generator.py
+++ b/tools/fs_config/fs_config_generator.py
@@ -1216,10 +1216,6 @@
class PasswdGen(BaseGenerator):
"""Generates the /etc/passwd file per man (5) passwd."""
- _GENERATED = ('#\n# THIS IS AN AUTOGENERATED FILE! DO NOT MODIFY!\n#')
-
- _FILE_COMMENT = '# Defined in file: \"%s\"'
-
def __init__(self):
self._old_file = None
@@ -1235,22 +1231,31 @@
help='An android_filesystem_config.h file'
'to parse AIDs and OEM Ranges from')
+ opt_group.add_argument(
+ '--required-prefix',
+ required=False,
+ help='A prefix that the names are required to contain.')
+
def __call__(self, args):
hdr_parser = AIDHeaderParser(args['aid_header'])
parser = FSConfigFileParser(args['fsconfig'], hdr_parser.oem_ranges)
+ required_prefix = args['required_prefix']
+
aids = parser.aids
# nothing to do if no aids defined
if len(aids) == 0:
return
- print PasswdGen._GENERATED
-
for aid in aids:
- self._print_formatted_line(aid)
+ if required_prefix is None or aid.friendly.startswith(required_prefix):
+ self._print_formatted_line(aid)
+ else:
+ sys.exit("%s: AID '%s' must start with '%s'" %
+ (args['fsconfig'], aid.friendly, required_prefix))
def _print_formatted_line(self, aid):
"""Prints the aid to stdout in the passwd format. Internal use only.
@@ -1269,7 +1274,6 @@
"""
if self._old_file != aid.found:
self._old_file = aid.found
- print PasswdGen._FILE_COMMENT % aid.found
try:
logon, uid = Utils.get_login_and_uid_cleansed(aid)
@@ -1295,7 +1299,6 @@
"""
if self._old_file != aid.found:
self._old_file = aid.found
- print PasswdGen._FILE_COMMENT % aid.found
try:
logon, uid = Utils.get_login_and_uid_cleansed(aid)
diff --git a/tools/releasetools/ota_from_target_files.py b/tools/releasetools/ota_from_target_files.py
index 1e2f39e..10a19b3 100755
--- a/tools/releasetools/ota_from_target_files.py
+++ b/tools/releasetools/ota_from_target_files.py
@@ -65,24 +65,29 @@
when installed.
--downgrade
- Intentionally generate an incremental OTA that updates from a newer
- build to an older one (based on timestamp comparison). "post-timestamp"
- will be replaced by "ota-downgrade=yes" in the metadata file. A data
- wipe will always be enforced, so "ota-wipe=yes" will also be included in
- the metadata file. The update-binary in the source build will be used in
- the OTA package, unless --binary flag is specified. Please also check the
- doc for --override_timestamp below.
+ Intentionally generate an incremental OTA that updates from a newer build
+ to an older one (e.g. downgrading from P preview back to O MR1).
+ "ota-downgrade=yes" will be set in the package metadata file. A data wipe
+ will always be enforced when using this flag, so "ota-wipe=yes" will also
+ be included in the metadata file. The update-binary in the source build
+ will be used in the OTA package, unless --binary flag is specified. Please
+ also check the comment for --override_timestamp below.
--override_timestamp
- Intentionally generate an incremental OTA that updates from a newer
- build to an older one (based on timestamp comparison), by overriding the
- timestamp in package metadata. This differs from --downgrade flag: we
- know for sure this is NOT an actual downgrade case, but two builds are
- cut in a reverse order. A legit use case is that we cut a new build C
- (after having A and B), but want to enfore an update path of A -> C -> B.
- Specifying --downgrade may not help since that would enforce a data wipe
- for C -> B update. The value of "post-timestamp" will be set to the newer
- timestamp plus one, so that the package can be pushed and applied.
+ Intentionally generate an incremental OTA that updates from a newer build
+ to an older one (based on timestamp comparison), by setting the downgrade
+ flag in the package metadata. This differs from --downgrade flag, as we
+ don't enforce a data wipe with this flag. Because we know for sure this is
+ NOT an actual downgrade case, but two builds happen to be cut in a reverse
+ order (e.g. from two branches). A legit use case is that we cut a new
+ build C (after having A and B), but want to enfore an update path of A ->
+ C -> B. Specifying --downgrade may not help since that would enforce a
+ data wipe for C -> B update.
+
+ We used to set a fake timestamp in the package metadata for this flow. But
+ now we consolidate the two cases (i.e. an actual downgrade, or a downgrade
+ based on timestamp) with the same "ota-downgrade=yes" flag, with the
+ difference being whether "ota-wipe=yes" is set.
-e (--extra_script) <file>
Insert the contents of file at the end of the update script.
@@ -180,7 +185,6 @@
OPTIONS.patch_threshold = 0.95
OPTIONS.wipe_user_data = False
OPTIONS.downgrade = False
-OPTIONS.timestamp = False
OPTIONS.extra_script = None
OPTIONS.worker_threads = multiprocessing.cpu_count() // 2
if OPTIONS.worker_threads == 0:
@@ -898,23 +902,16 @@
if OPTIONS.downgrade:
if not is_downgrade:
- raise RuntimeError("--downgrade specified but no downgrade detected: "
- "pre: %s, post: %s" % (pre_timestamp, post_timestamp))
+ raise RuntimeError(
+ "--downgrade or --override_timestamp specified but no downgrade "
+ "detected: pre: %s, post: %s" % (pre_timestamp, post_timestamp))
metadata["ota-downgrade"] = "yes"
- elif OPTIONS.timestamp:
- if not is_downgrade:
- raise RuntimeError("--override_timestamp specified but no timestamp hack "
- "needed: pre: %s, post: %s" % (pre_timestamp,
- post_timestamp))
- metadata["post-timestamp"] = str(long(pre_timestamp) + 1)
else:
if is_downgrade:
- raise RuntimeError("Downgrade detected based on timestamp check: "
- "pre: %s, post: %s. Need to specify "
- "--override_timestamp OR --downgrade to allow "
- "building the incremental." % (pre_timestamp,
- post_timestamp))
- metadata["post-timestamp"] = post_timestamp
+ raise RuntimeError(
+ "Downgrade detected based on timestamp check: pre: %s, post: %s. "
+ "Need to specify --override_timestamp OR --downgrade to allow "
+ "building the incremental." % (pre_timestamp, post_timestamp))
def GetPackageMetadata(target_info, source_info=None):
@@ -922,7 +919,7 @@
It generates a dict() that contains the info to be written into an OTA
package (META-INF/com/android/metadata). It also handles the detection of
- downgrade / timestamp override / data wipe based on the global options.
+ downgrade / data wipe based on the global options.
Args:
target_info: The BuildInfo instance that holds the target build info.
@@ -963,11 +960,12 @@
else:
metadata['pre-device'] = target_info.device
- # Detect downgrades, or fill in the post-timestamp.
+ # Use the actual post-timestamp, even for a downgrade case.
+ metadata['post-timestamp'] = target_info.GetBuildProp('ro.build.date.utc')
+
+ # Detect downgrades and set up downgrade flags accordingly.
if is_incremental:
HandleDowngradeMetadata(metadata, target_info, source_info)
- else:
- metadata['post-timestamp'] = target_info.GetBuildProp('ro.build.date.utc')
return metadata
@@ -1791,7 +1789,7 @@
OPTIONS.downgrade = True
OPTIONS.wipe_user_data = True
elif o == "--override_timestamp":
- OPTIONS.timestamp = True
+ OPTIONS.downgrade = True
elif o in ("-o", "--oem_settings"):
OPTIONS.oem_source = a.split(',')
elif o == "--oem_no_mount":
@@ -1869,19 +1867,12 @@
sys.exit(1)
if OPTIONS.downgrade:
- # Sanity check to enforce a data wipe.
- if not OPTIONS.wipe_user_data:
- raise ValueError("Cannot downgrade without a data wipe")
-
# We should only allow downgrading incrementals (as opposed to full).
# Otherwise the device may go back from arbitrary build with this full
# OTA package.
if OPTIONS.incremental_source is None:
raise ValueError("Cannot generate downgradable full OTAs")
- assert not (OPTIONS.downgrade and OPTIONS.timestamp), \
- "Cannot have --downgrade AND --override_timestamp both"
-
# Load the build info dicts from the zip directly or the extracted input
# directory. We don't need to unzip the entire target-files zips, because they
# won't be needed for A/B OTAs (brillo_update_payload does that on its own).
diff --git a/tools/releasetools/test_ota_from_target_files.py b/tools/releasetools/test_ota_from_target_files.py
index d7cace8..262e701 100644
--- a/tools/releasetools/test_ota_from_target_files.py
+++ b/tools/releasetools/test_ota_from_target_files.py
@@ -524,31 +524,7 @@
'post-build-incremental' : 'build-version-incremental-target',
'post-sdk-level' : '27',
'post-security-patch-level' : '2017-12-01',
- 'pre-device' : 'product-device',
- 'pre-build' : 'build-fingerprint-source',
- 'pre-build-incremental' : 'build-version-incremental-source',
- },
- metadata)
-
- def test_GetPackageMetadata_overrideTimestamp(self):
- target_info_dict = copy.deepcopy(self.TEST_TARGET_INFO_DICT)
- source_info_dict = copy.deepcopy(self.TEST_SOURCE_INFO_DICT)
- self._test_GetPackageMetadata_swapBuildTimestamps(
- target_info_dict, source_info_dict)
-
- target_info = BuildInfo(target_info_dict, None)
- source_info = BuildInfo(source_info_dict, None)
- common.OPTIONS.incremental_source = ''
- common.OPTIONS.timestamp = True
- metadata = GetPackageMetadata(target_info, source_info)
- self.assertDictEqual(
- {
- 'ota-type' : 'BLOCK',
- 'post-build' : 'build-fingerprint-target',
- 'post-build-incremental' : 'build-version-incremental-target',
- 'post-sdk-level' : '27',
- 'post-security-patch-level' : '2017-12-01',
- 'post-timestamp' : '1500000001',
+ 'post-timestamp' : '1400000000',
'pre-device' : 'product-device',
'pre-build' : 'build-fingerprint-source',
'pre-build-incremental' : 'build-version-incremental-source',
diff --git a/tools/releasetools/validate_target_files.py b/tools/releasetools/validate_target_files.py
index 68070ba..8c9e07c 100755
--- a/tools/releasetools/validate_target_files.py
+++ b/tools/releasetools/validate_target_files.py
@@ -81,6 +81,12 @@
logging.warning('Skipping %s that has incomplete block list', entry)
continue
+ # TODO(b/79951650): Handle files with non-monotonic ranges.
+ if not ranges.monotonic:
+ logging.warning(
+ 'Skipping %s that has non-monotonic ranges: %s', entry, ranges)
+ continue
+
blocks_sha1 = image.RangeSha1(ranges)
# The filename under unpacked directory, such as SYSTEM/bin/sh.