Merge "Reapply "Add libcgrouprc to multilib.both.deps"" into main
diff --git a/ci/Android.bp b/ci/Android.bp
index 6d4ac35..0dfbd37 100644
--- a/ci/Android.bp
+++ b/ci/Android.bp
@@ -102,6 +102,7 @@
"optimized_targets.py",
"test_mapping_module_retriever.py",
"build_context.py",
+ "test_discovery_agent.py",
],
}
diff --git a/ci/test_discovery_agent.py b/ci/test_discovery_agent.py
new file mode 100644
index 0000000..89d35d7
--- /dev/null
+++ b/ci/test_discovery_agent.py
@@ -0,0 +1,46 @@
+# Copyright 2024, 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.
+class TestDiscoveryAgent:
+ """Test discovery agent."""
+
+ _AOSP_TRADEFED_PREBUILT_JAR_RELATIVE_PATH = (
+ "tools/tradefederation/prebuilts/filegroups/tradefed/"
+ )
+
+ def __init__(
+ self,
+ tradefed_args: list[str],
+ test_mapping_zip_path: str,
+ tradefed_jar_revelant_files_path: str = _AOSP_TRADEFED_PREBUILT_JAR_RELATIVE_PATH,
+ ):
+ self.tradefed_args = tradefed_args
+ self.test_mapping_zip_path = test_mapping_zip_path
+ self.tradefed_jar_relevant_files_path = tradefed_jar_revelant_files_path
+
+ def discover_test_zip_regexes(self) -> list[str]:
+ """Discover test zip regexes from TradeFed.
+
+ Returns:
+ A list of test zip regexes that TF is going to try to pull files from.
+ """
+ return []
+
+ def discover_test_modules(self) -> list[str]:
+ """Discover test modules from TradeFed.
+
+ Returns:
+ A list of test modules that TradeFed is going to execute based on the
+ TradeFed test args.
+ """
+ return []
diff --git a/core/Makefile b/core/Makefile
index 81ae6f7..372eb05 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -3488,12 +3488,14 @@
# $(2): The partition's staging directory
# $(3): Files to include in the partition
define write-partition-file-list
+$(1): PRIVATE_FILES := $(subst $(2)/,,$(filter $(2)/%,$(3)))
+$(1): PRIVATE_EXTRA_INSTALL_ZIPS := $(call relevant-extra-install-zips,$(filter $(2)/%,$(3)))
$(1): $$(HOST_OUT_EXECUTABLES)/extra_install_zips_file_list $(foreach p,$(call relevant-extra-install-zips,$(filter $(2)/%,$(3))),$(call word-colon,3,$(p)))
@echo Writing $$@
rm -f $$@
echo -n > $$@
- $$(foreach f,$(subst $(2)/,,$(filter $(2)/%,$(3))),echo "$$(f)" >> $$@$$(newline))
- $$(HOST_OUT_EXECUTABLES)/extra_install_zips_file_list $(2) $(call relevant-extra-install-zips,$(filter $(2)/%,$(3))) >> $$@
+ $$(foreach f,$$(PRIVATE_FILES),echo "$$(f)" >> $$@$$(newline))
+ $$(HOST_OUT_EXECUTABLES)/extra_install_zips_file_list $(2) $$(PRIVATE_EXTRA_INSTALL_ZIPS) >> $$@
endef
# -----------------------------------------------------------------
diff --git a/core/android_soong_config_vars.mk b/core/android_soong_config_vars.mk
index 06dc54c..70991c6 100644
--- a/core/android_soong_config_vars.mk
+++ b/core/android_soong_config_vars.mk
@@ -30,13 +30,18 @@
$(call soong_config_set_bool,ANDROID,BOARD_USES_RECOVERY_AS_BOOT,$(BOARD_USES_RECOVERY_AS_BOOT))
$(call soong_config_set_bool,ANDROID,BOARD_MOVE_GSI_AVB_KEYS_TO_VENDOR_BOOT,$(BOARD_MOVE_GSI_AVB_KEYS_TO_VENDOR_BOOT))
$(call add_soong_config_var,ANDROID,CHECK_DEV_TYPE_VIOLATIONS)
+$(call soong_config_set_bool,ANDROID,HAS_BOARD_SYSTEM_EXT_PREBUILT_DIR,$(if $(BOARD_SYSTEM_EXT_PREBUILT_DIR),true,false))
+$(call soong_config_set_bool,ANDROID,HAS_BOARD_PRODUCT_PREBUILT_DIR,$(if $(BOARD_PRODUCT_PREBUILT_DIR),true,false))
$(call add_soong_config_var,ANDROID,PLATFORM_SEPOLICY_VERSION)
$(call add_soong_config_var,ANDROID,PLATFORM_SEPOLICY_COMPAT_VERSIONS)
$(call add_soong_config_var,ANDROID,PRODUCT_INSTALL_DEBUG_POLICY_TO_SYSTEM_EXT)
+$(call soong_config_set_bool,ANDROID,RELEASE_BOARD_API_LEVEL_FROZEN,$(RELEASE_BOARD_API_LEVEL_FROZEN))
$(call add_soong_config_var,ANDROID,TARGET_DYNAMIC_64_32_DRMSERVER)
$(call add_soong_config_var,ANDROID,TARGET_ENABLE_MEDIADRM_64)
$(call add_soong_config_var,ANDROID,TARGET_DYNAMIC_64_32_MEDIASERVER)
+$(call add_soong_config_var,ANDROID,ADDITIONAL_M4DEFS,$(if $(BOARD_SEPOLICY_M4DEFS),$(addprefix -D,$(BOARD_SEPOLICY_M4DEFS))))
+
# For Sanitizers
$(call soong_config_set_bool,ANDROID,ASAN_ENABLED,$(if $(filter address,$(SANITIZE_TARGET)),true,false))
$(call soong_config_set_bool,ANDROID,HWASAN_ENABLED,$(if $(filter hwaddress,$(SANITIZE_TARGET)),true,false))
@@ -208,3 +213,16 @@
# Export board_uses_scaler_m2m1shot and board_uses_align_restriction to soong for hardware/google/graphics/common/libscaler:libexynosscaler
$(call soong_config_set_bool,google_graphics,board_uses_scaler_m2m1shot,$(if $(filter true,$(BOARD_USES_SCALER_M2M1SHOT)),true,false))
$(call soong_config_set_bool,google_graphics,board_uses_align_restriction,$(if $(filter true,$(BOARD_USES_ALIGN_RESTRICTION)),true,false))
+
+# Export video_codec variables to soong for exynos modules
+$(call soong_config_set,video_codec,target_soc_name,$(TARGET_SOC_NAME))
+$(call soong_config_set_bool,video_codec,board_use_codec2_hidl_1_2,$(if $(filter true,$(BOARD_USE_CODEC2_HIDL_1_2)),true,false))
+$(call soong_config_set_bool,video_codec,board_support_mfc_enc_bt2020,$(if $(filter true,$(BOARD_SUPPORT_MFC_ENC_BT2020)),true,false))
+$(call soong_config_set_bool,video_codec,board_support_flexible_p010,$(if $(filter true,$(BOARD_SUPPORT_FLEXIBLE_P010)),true,false))
+$(call soong_config_set,video_codec,board_support_mfc_version,$(BOARD_SUPPORT_MFC_VERSION))
+$(call soong_config_set_bool,video_codec,board_use_codec2_aidl,$(if $(BOARD_USE_CODEC2_AIDL),true,false))
+$(call soong_config_set,video_codec,board_gpu_type,$(BOARD_GPU_TYPE))
+$(call soong_config_set_bool,video_codec,board_use_small_secure_memory,$(if $(filter true,$(BOARD_USE_SMALL_SECURE_MEMORY)),true,false))
+ifneq ($(BOARD_USE_MAX_SECURE_RESOURCE),)
+ $(call soong_config_set,video_codec,board_use_max_secure_resource,$(BOARD_USE_MAX_SECURE_RESOURCE))
+endif
diff --git a/core/binary.mk b/core/binary.mk
index 3481144..ea862be 100644
--- a/core/binary.mk
+++ b/core/binary.mk
@@ -174,7 +174,7 @@
endif
endif
-my_ndk_sysroot_include :=
+my_ndk_sysroot :=
my_ndk_sysroot_lib :=
my_api_level := 10000
@@ -207,11 +207,9 @@
my_built_ndk := $(SOONG_OUT_DIR)/ndk
my_ndk_triple := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_NDK_TRIPLE)
- my_ndk_sysroot_include := \
- $(my_built_ndk)/sysroot/usr/include \
- $(my_built_ndk)/sysroot/usr/include/$(my_ndk_triple) \
+ my_ndk_sysroot := $(my_built_ndk)/sysroot
- my_ndk_sysroot_lib := $(my_built_ndk)/sysroot/usr/lib/$(my_ndk_triple)/$(my_ndk_api)
+ my_ndk_sysroot_lib := $(my_ndk_sysroot)/usr/lib/$(my_ndk_triple)/$(my_ndk_api)
# The bionic linker now has support for packed relocations and gnu style
# hashes (which are much faster!), but shipping to older devices requires
@@ -1628,19 +1626,6 @@
###########################################################
ifndef LOCAL_IS_HOST_MODULE
-ifeq ($(call module-in-vendor-or-product),true)
- my_target_global_c_includes :=
- my_target_global_c_system_includes := $(TARGET_OUT_HEADERS)
-else ifdef LOCAL_SDK_VERSION
- my_target_global_c_includes :=
- my_target_global_c_system_includes := $(my_ndk_stl_include_path) $(my_ndk_sysroot_include)
-else
- my_target_global_c_includes := $(SRC_HEADERS) \
- $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)C_INCLUDES)
- my_target_global_c_system_includes := $(SRC_SYSTEM_HEADERS) \
- $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)C_SYSTEM_INCLUDES)
-endif
-
my_target_global_cflags := $($(LOCAL_2ND_ARCH_VAR_PREFIX)CLANG_$(my_prefix)GLOBAL_CFLAGS)
my_target_global_conlyflags := $($(LOCAL_2ND_ARCH_VAR_PREFIX)CLANG_$(my_prefix)GLOBAL_CONLYFLAGS) $(my_c_std_conlyflags)
my_target_global_cppflags := $($(LOCAL_2ND_ARCH_VAR_PREFIX)CLANG_$(my_prefix)GLOBAL_CPPFLAGS) $(my_cpp_std_cppflags)
@@ -1656,6 +1641,22 @@
my_target_global_ldflags := $($(LOCAL_2ND_ARCH_VAR_PREFIX)CLANG_$(my_prefix)GLOBAL_LDFLAGS)
endif # my_use_clang_lld
+ifeq ($(call module-in-vendor-or-product),true)
+ my_target_global_c_includes :=
+ my_target_global_c_system_includes := $(TARGET_OUT_HEADERS)
+ my_target_global_cflags += -nostdlibinc
+else ifdef LOCAL_SDK_VERSION
+ my_target_global_c_includes :=
+ my_target_global_c_system_includes := $(my_ndk_stl_include_path)
+ my_target_global_cflags += --sysroot $(my_ndk_sysroot)
+else
+ my_target_global_c_includes := $(SRC_HEADERS) \
+ $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)C_INCLUDES)
+ my_target_global_c_system_includes := $(SRC_SYSTEM_HEADERS) \
+ $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)C_SYSTEM_INCLUDES)
+ my_target_global_cflags += -nostdlibinc
+endif
+
my_target_triple := $($(LOCAL_2ND_ARCH_VAR_PREFIX)CLANG_$(my_prefix)TRIPLE)
ifndef LOCAL_IS_HOST_MODULE
my_target_triple_flag := -target $(my_target_triple)$(my_api_level)
diff --git a/core/config.mk b/core/config.mk
index 192c8b2..2df9a2d 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -432,13 +432,6 @@
endif
.KATI_READONLY := TARGET_MAX_PAGE_SIZE_SUPPORTED
-ifdef PRODUCT_CHECK_PREBUILT_MAX_PAGE_SIZE
- TARGET_CHECK_PREBUILT_MAX_PAGE_SIZE := $(PRODUCT_CHECK_PREBUILT_MAX_PAGE_SIZE)
-else
- TARGET_CHECK_PREBUILT_MAX_PAGE_SIZE := false
-endif
-.KATI_READONLY := TARGET_CHECK_PREBUILT_MAX_PAGE_SIZE
-
# Boolean variable determining if AOSP relies on bionic's PAGE_SIZE macro.
ifdef PRODUCT_NO_BIONIC_PAGE_SIZE_MACRO
TARGET_NO_BIONIC_PAGE_SIZE_MACRO := $(PRODUCT_NO_BIONIC_PAGE_SIZE_MACRO)
@@ -817,6 +810,18 @@
endif
endif
+ifdef PRODUCT_CHECK_PREBUILT_MAX_PAGE_SIZE
+ TARGET_CHECK_PREBUILT_MAX_PAGE_SIZE := $(PRODUCT_CHECK_PREBUILT_MAX_PAGE_SIZE)
+else ifeq (true,$(TARGET_BUILD_UNBUNDLED))
+ # unbundled builds may not have updated build sources
+ TARGET_CHECK_PREBUILT_MAX_PAGE_SIZE := false
+else ifneq ($(call math_gt_or_eq,$(PRODUCT_SHIPPING_API_LEVEL),36),)
+ TARGET_CHECK_PREBUILT_MAX_PAGE_SIZE := true
+else
+ TARGET_CHECK_PREBUILT_MAX_PAGE_SIZE := false
+endif
+.KATI_READONLY := TARGET_CHECK_PREBUILT_MAX_PAGE_SIZE
+
# Set BOARD_SYSTEMSDK_VERSIONS to the latest SystemSDK version starting from P-launching
# devices if unset.
ifndef BOARD_SYSTEMSDK_VERSIONS
diff --git a/core/config_sanitizers.mk b/core/config_sanitizers.mk
index c0f2c68..ab2d5c1 100644
--- a/core/config_sanitizers.mk
+++ b/core/config_sanitizers.mk
@@ -284,9 +284,9 @@
ifneq ($(filter memtag_stack,$(my_sanitize)),)
my_cflags += -fsanitize=memtag-stack
my_ldflags += -fsanitize=memtag-stack
- my_cflags += -Xclang -target-feature -Xclang +mte
- my_ldflags += -Xclang -target-feature -Xclang +mte
- my_asflags += -Xclang -target-feature -Xclang +mte
+ my_cflags += -march=armv8a+memtag
+ my_ldflags += -march=armv8a+memtag
+ my_asflags += -march=armv8a+memtag
my_sanitize := $(filter-out memtag_stack,$(my_sanitize))
endif
diff --git a/core/main.mk b/core/main.mk
index 5bbe1b1..24055e8 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -290,7 +290,7 @@
$(foreach mk,$(subdir_makefiles),$(info [$(call inc_and_print,subdir_makefiles_inc)/$(subdir_makefiles_total)] including $(mk) ...)$(eval include $(mk)))
# Build bootloader.img/radio.img, and unpack the partitions.
-include $(BUILD_SYSTEM)/tasks/tools/update_bootloader_radio_image.mk
+-include vendor/google/build/tasks/tools/update_bootloader_radio_image.mk
# For an unbundled image, we can skip blueprint_tools because unbundled image
# aims to remove a large number framework projects from the manifest, the
@@ -981,7 +981,9 @@
# Returns modules included automatically as a result of certain BoardConfig
# variables being set.
define auto-included-modules
- llndk_in_system \
+ $(foreach vndk_ver,$(PRODUCT_EXTRA_VNDK_VERSIONS),com.android.vndk.v$(vndk_ver)) \
+ $(filter-out $(LLNDK_MOVED_TO_APEX_LIBRARIES),$(LLNDK_LIBRARIES)) \
+ llndk.libraries.txt \
$(if $(DEVICE_MANIFEST_FILE),vendor_manifest.xml) \
$(if $(DEVICE_MANIFEST_SKUS),$(foreach sku, $(DEVICE_MANIFEST_SKUS),vendor_manifest_$(sku).xml)) \
$(if $(ODM_MANIFEST_FILES),odm_manifest.xml) \
diff --git a/core/ravenwood_test_config_template.xml b/core/ravenwood_test_config_template.xml
index 2f21bae..9e9dd76 100644
--- a/core/ravenwood_test_config_template.xml
+++ b/core/ravenwood_test_config_template.xml
@@ -22,6 +22,7 @@
<option name="use-ravenwood-resources" value="true" />
<option name="exclude-paths" value="java" />
<option name="null-device" value="true" />
+ <option name="do-not-swallow-runner-errors" value="true" />
{EXTRA_CONFIGS}
diff --git a/core/robolectric_test_config_template.xml b/core/robolectric_test_config_template.xml
index b1d0c2f..257c820 100644
--- a/core/robolectric_test_config_template.xml
+++ b/core/robolectric_test_config_template.xml
@@ -33,5 +33,15 @@
<option name="java-flags" value="--add-opens=java.base/jdk.internal.util.random=ALL-UNNAMED"/>
<!-- b/251387255 -->
<option name="java-flags" value="--add-opens=java.base/java.io=ALL-UNNAMED"/>
+ <option name="java-flags" value="--add-opens=java.base/java.net=ALL-UNNAMED"/>
+ <option name="java-flags" value="--add-opens=java.base/java.nio=ALL-UNNAMED"/> <!-- required for ShadowVMRuntime -->
+ <option name="java-flags" value="--add-opens=java.base/java.security=ALL-UNNAMED"/>
+ <option name="java-flags" value="--add-opens=java.base/java.text=ALL-UNNAMED"/>
+ <option name="java-flags" value="--add-opens=java.base/java.util=ALL-UNNAMED"/>
+ <option name="java-flags" value="--add-opens=java.base/jdk.internal.access=ALL-UNNAMED"/>
+ <option name="java-flags" value="--add-opens=java.desktop/java.awt.font=ALL-UNNAMED"/>
+ <option name="java-flags" value="--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED"/>
+ <option name="java-flags" value="--add-opens=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED"/>
+ <option name="java-flags" value="--add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED"/>
</test>
</configuration>
diff --git a/core/soong_config.mk b/core/soong_config.mk
index aaeb70f..8c57ce6 100644
--- a/core/soong_config.mk
+++ b/core/soong_config.mk
@@ -316,6 +316,8 @@
$(call add_json_str, ProductManufacturer, $(PRODUCT_MANUFACTURER))
$(call add_json_str, ProductBrand, $(PRODUCT_BRAND))
+$(call add_json_str, ProductDevice, $(PRODUCT_DEVICE))
+$(call add_json_str, ProductModel, $(PRODUCT_MODEL))
$(call add_json_str, ReleaseVersion, $(_RELEASE_VERSION))
$(call add_json_list, ReleaseAconfigValueSets, $(RELEASE_ACONFIG_VALUE_SETS))
diff --git a/target/product/gsi/Android.mk b/core/tasks/check-abi-dump-list.mk
similarity index 81%
rename from target/product/gsi/Android.mk
rename to core/tasks/check-abi-dump-list.mk
index 7291059..81d549e 100644
--- a/target/product/gsi/Android.mk
+++ b/core/tasks/check-abi-dump-list.mk
@@ -1,4 +1,16 @@
-LOCAL_PATH:= $(call my-dir)
+# Copyright (C) 2024 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.
#####################################################################
# Check the generate list against the latest list stored in the
@@ -109,32 +121,3 @@
$(if $(added_vndk_abi_dumps)$(added_platform_abi_dumps),exit 1)
$(hide) mkdir -p $(dir $@)
$(hide) touch $@
-
-#####################################################################
-# VNDK package and snapshot.
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := vndk_apex_snapshot_package
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
-LOCAL_LICENSE_CONDITIONS := notice
-LOCAL_NOTICE_FILE := build/soong/licenses/LICENSE
-LOCAL_REQUIRED_MODULES := $(foreach vndk_ver,$(PRODUCT_EXTRA_VNDK_VERSIONS),com.android.vndk.v$(vndk_ver))
-include $(BUILD_PHONY_PACKAGE)
-
-#####################################################################
-# Define Phony module to install LLNDK modules which are installed in
-# the system image
-include $(CLEAR_VARS)
-LOCAL_MODULE := llndk_in_system
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
-LOCAL_LICENSE_CONDITIONS := notice
-LOCAL_NOTICE_FILE := build/soong/licenses/LICENSE
-
-# Filter LLNDK libs moved to APEX to avoid pulling them into /system/LIB
-LOCAL_REQUIRED_MODULES := \
- $(filter-out $(LLNDK_MOVED_TO_APEX_LIBRARIES),$(LLNDK_LIBRARIES)) \
- llndk.libraries.txt
-
-
-include $(BUILD_PHONY_PACKAGE)
diff --git a/core/tasks/prebuilt_tradefed.mk b/core/tasks/prebuilt_tradefed.mk
new file mode 100644
index 0000000..96c57d5
--- /dev/null
+++ b/core/tasks/prebuilt_tradefed.mk
@@ -0,0 +1,22 @@
+# Copyright (C) 2020 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.
+
+ifeq (,$(wildcard tools/tradefederation/core))
+.PHONY: tradefed-core
+tradefed-core: tradefed atest_tradefed.sh
+.PHONY: tradefed-all
+tradefed-all: tradefed atest_tradefed.sh
+
+$(call dist-for-goals, tradefed, $(HOST_OUT)/etc/tradefed.zip)
+endif
diff --git a/core/tasks/tools/update_bootloader_radio_image.mk b/core/tasks/tools/update_bootloader_radio_image.mk
deleted file mode 100644
index 0ebf247..0000000
--- a/core/tasks/tools/update_bootloader_radio_image.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright (C) 2024 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.
-
-ifeq ($(USES_DEVICE_GOOGLE_ZUMA),true)
- -include vendor/google_devices/zuma/prebuilts/misc_bins/update_bootloader_radio_image.mk
-endif
diff --git a/shell_utils.sh b/shell_utils.sh
index c4a6756..9053c42 100644
--- a/shell_utils.sh
+++ b/shell_utils.sh
@@ -178,11 +178,11 @@
echo -n "${color_failed}#### failed to build some targets "
fi
if [ $hours -gt 0 ] ; then
- printf "(%02g:%02g:%02g (hh:mm:ss))" $hours $mins $secs
+ printf "(%02d:%02d:%02d (hh:mm:ss))" $hours $mins $secs
elif [ $mins -gt 0 ] ; then
- printf "(%02g:%02g (mm:ss))" $mins $secs
+ printf "(%02d:%02d (mm:ss))" $mins $secs
elif [ $secs -gt 0 ] ; then
- printf "(%s seconds)" $secs
+ printf "(%d seconds)" $secs
fi
echo " ####${color_reset}"
echo
diff --git a/target/product/base_vendor.mk b/target/product/base_vendor.mk
index a80e0b3..3f85941 100644
--- a/target/product/base_vendor.mk
+++ b/target/product/base_vendor.mk
@@ -17,7 +17,6 @@
# Base modules and settings for recovery.
PRODUCT_PACKAGES += \
adbd.recovery \
- android.hardware.health@2.0-impl-default.recovery \
build_flag_vendor \
cgroups.recovery.json \
charger.recovery \
diff --git a/target/product/generic/Android.bp b/target/product/generic/Android.bp
index 973db48..93f7c36 100644
--- a/target/product/generic/Android.bp
+++ b/target/product/generic/Android.bp
@@ -76,6 +76,49 @@
target: "/product/etc/security/adb_keys",
name: "adb_keys",
},
+ // For Treble Generic System Image (GSI), system-as-root GSI needs to work on both devices with
+ // and without /odm partition. Those symlinks are for devices without /odm partition. For
+ // devices with /odm partition, mount odm.img under /odm will hide those symlinks.
+ {
+ target: "/vendor/odm/app",
+ name: "odm/app",
+ },
+ {
+ target: "/vendor/odm/bin",
+ name: "odm/bin",
+ },
+ {
+ target: "/vendor/odm/etc",
+ name: "odm/etc",
+ },
+ {
+ target: "/vendor/odm/firmware",
+ name: "odm/firmware",
+ },
+ {
+ target: "/vendor/odm/framework",
+ name: "odm/framework",
+ },
+ {
+ target: "/vendor/odm/lib",
+ name: "odm/lib",
+ },
+ {
+ target: "/vendor/odm/lib64",
+ name: "odm/lib64",
+ },
+ {
+ target: "/vendor/odm/overlay",
+ name: "odm/overlay",
+ },
+ {
+ target: "/vendor/odm/priv-app",
+ name: "odm/priv-app",
+ },
+ {
+ target: "/vendor/odm/usr",
+ name: "odm/usr",
+ },
]
filegroup {
@@ -318,6 +361,11 @@
],
libs: [":framework-res{.export-package.apk}"],
},
+ type: "erofs",
+ erofs: {
+ compressor: "lz4hc,9",
+ compress_hints: "erofs_compress_hints.txt",
+ },
build_logtags: true,
gen_aconfig_flags_pb: true,
@@ -405,7 +453,6 @@
"init.zygote32.rc",
"init.zygote64.rc",
"init.zygote64_32.rc",
- "init_first_stage", // for boot partition
"initial-package-stopped-states.xml",
"input",
"installd",
@@ -419,7 +466,6 @@
"ld.mc",
"llkd", // base_system
"lmkd", // base_system
- "local_time.default", // handheld_vendo
"locksettings", // base_system
"logcat", // base_system
"logd", // base_system
@@ -481,7 +527,6 @@
"sm", // base_system
"snapshotctl", // base_system
"snapuserd", // base_system
- "snapuserd_ramdisk", // ramdisk
"storaged", // base_system
"surfaceflinger", // base_system
"svc", // base_system
@@ -581,6 +626,7 @@
"ContactsProvider", // base_system
"CredentialManager", // handheld_system
"DeviceAsWebcam", // handheld_system
+ "DeviceDiagnostics", // handheld_system - internal
"DocumentsUI", // handheld_system
"DownloadProvider", // base_system
"DownloadProviderUi", // handheld_system
@@ -606,7 +652,6 @@
"PacProcessor", // handheld_system
"PackageInstaller", // base_system
"PartnerBookmarksProvider", // generic_system
- "PhotoTable", // full_base
"PrintRecommendationService", // handheld_system
"PrintSpooler", // handheld_system
"ProxyHandler", // handheld_system
diff --git a/target/product/generic/erofs_compress_hints.txt b/target/product/generic/erofs_compress_hints.txt
new file mode 100644
index 0000000..8b2a711
--- /dev/null
+++ b/target/product/generic/erofs_compress_hints.txt
@@ -0,0 +1 @@
+0 .*\.apex$
\ No newline at end of file
diff --git a/target/product/media_system_ext.mk b/target/product/media_system_ext.mk
index 30dd2e2..e79a7eb 100644
--- a/target/product/media_system_ext.mk
+++ b/target/product/media_system_ext.mk
@@ -20,9 +20,5 @@
# base_system_ext.mk.
$(call inherit-product, $(SRC_TARGET_DIR)/product/base_system_ext.mk)
-# /system_ext packages
-PRODUCT_PACKAGES += \
- vndk_apex_snapshot_package \
-
# Window Extensions
$(call inherit-product, $(SRC_TARGET_DIR)/product/window_extensions_base.mk)
diff --git a/teams/Android.bp b/teams/Android.bp
index 96d241b..8f29686 100644
--- a/teams/Android.bp
+++ b/teams/Android.bp
@@ -13,6 +13,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+// DON'T ADD NEW RULES HERE. For more details refer to
+// go/new-android-ownership-model
+
package {
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -4454,3 +4457,27 @@
// go/trendy/manage/engineers/5121440647577600
trendy_team_id: "5121440647577600",
}
+
+team {
+ name: "trendy_team_ravenwood",
+
+ // go/trendy/manage/engineers/6027181500497920
+ trendy_team_id: "6027181500497920",
+}
+
+team {
+ name: "trendy_team_automotive_cast",
+
+ // go/trendy/manage/engineers/5293683026264064
+ trendy_team_id: "5293683026264064",
+}
+
+team {
+ name: "trendy_team_wear_standalone_kids",
+
+ // go/trendy/manage/engineers/6303298703949824
+ trendy_team_id: "6303298703949824",
+}
+
+// DON'T ADD NEW RULES HERE. For more details refer to
+// go/new-android-ownership-model
diff --git a/tools/aconfig/OWNERS b/tools/aconfig/OWNERS
index 9a76279..c92fc7c 100644
--- a/tools/aconfig/OWNERS
+++ b/tools/aconfig/OWNERS
@@ -1,7 +1,8 @@
-amhk@google.com
dzshen@google.com
-jham@google.com
-joeo@google.com
opg@google.com
tedbauer@google.com
zhidou@google.com
+
+amhk@google.com #{LAST_RESORT_SUGGESTION}
+jham@google.com #{LAST_RESORT_SUGGESTION}
+joeo@google.com #{LAST_RESORT_SUGGESTION}
diff --git a/tools/aconfig/aconfig/src/codegen/java.rs b/tools/aconfig/aconfig/src/codegen/java.rs
index a34166d..47d4042 100644
--- a/tools/aconfig/aconfig/src/codegen/java.rs
+++ b/tools/aconfig/aconfig/src/codegen/java.rs
@@ -531,15 +531,16 @@
private static boolean enabledRw = true;
private void init() {
StorageInternalReader reader = null;
+ boolean foundPackage = true;
try {
reader = new StorageInternalReader("system", "com.android.aconfig.test");
- disabledRw = reader.getBooleanFlagValue(1);
- disabledRwExported = reader.getBooleanFlagValue(2);
- enabledRw = reader.getBooleanFlagValue(8);
- disabledRwInOtherNamespace = reader.getBooleanFlagValue(3);
} catch (Exception e) {
- throw new RuntimeException("Cannot read flag in codegen", e);
+ foundPackage = false;
}
+ disabledRw = foundPackage ? reader.getBooleanFlagValue(1) : false;
+ disabledRwExported = foundPackage ? reader.getBooleanFlagValue(2) : false;
+ enabledRw = foundPackage ? reader.getBooleanFlagValue(8) : true;
+ disabledRwInOtherNamespace = foundPackage ? reader.getBooleanFlagValue(3) : false;
isCached = true;
}
private void load_overrides_aconfig_test() {
diff --git a/tools/aconfig/aconfig/src/codegen/rust.rs b/tools/aconfig/aconfig/src/codegen/rust.rs
index 7bc34d6..d318b96 100644
--- a/tools/aconfig/aconfig/src/codegen/rust.rs
+++ b/tools/aconfig/aconfig/src/codegen/rust.rs
@@ -295,7 +295,10 @@
get_boolean_flag_value(&flag_val_map, offset + 1)
.map_err(|err| format!("failed to get flag: {err}"))
},
- None => Err("no context found for package 'com.android.aconfig.test'".to_string())
+ None => {
+ log!(Level::Error, "no context found for package com.android.aconfig.test");
+ Ok(false)
+ }
}
})
});
@@ -339,7 +342,10 @@
get_boolean_flag_value(&flag_val_map, offset + 2)
.map_err(|err| format!("failed to get flag: {err}"))
},
- None => Err("no context found for package 'com.android.aconfig.test'".to_string())
+ None => {
+ log!(Level::Error, "no context found for package com.android.aconfig.test");
+ Ok(false)
+ }
}
})
});
@@ -383,7 +389,10 @@
get_boolean_flag_value(&flag_val_map, offset + 3)
.map_err(|err| format!("failed to get flag: {err}"))
},
- None => Err("no context found for package 'com.android.aconfig.test'".to_string())
+ None => {
+ log!(Level::Error, "no context found for package com.android.aconfig.test");
+ Ok(false)
+ }
}
})
});
@@ -428,7 +437,10 @@
get_boolean_flag_value(&flag_val_map, offset + 8)
.map_err(|err| format!("failed to get flag: {err}"))
},
- None => Err("no context found for package 'com.android.aconfig.test'".to_string())
+ None => {
+ log!(Level::Error, "no context found for package com.android.aconfig.test");
+ Ok(true)
+ }
}
})
});
diff --git a/tools/aconfig/aconfig/src/main.rs b/tools/aconfig/aconfig/src/main.rs
index edb4fd3..e184efe 100644
--- a/tools/aconfig/aconfig/src/main.rs
+++ b/tools/aconfig/aconfig/src/main.rs
@@ -51,8 +51,7 @@
.subcommand(
Command::new("create-cache")
.arg(Arg::new("package").long("package").required(true))
- // TODO(b/312769710): Make this argument required.
- .arg(Arg::new("container").long("container"))
+ .arg(Arg::new("container").long("container").required(true))
.arg(Arg::new("declarations").long("declarations").action(ArgAction::Append))
.arg(Arg::new("values").long("values").action(ArgAction::Append))
.arg(
diff --git a/tools/aconfig/aconfig/templates/FeatureFlags.java.template b/tools/aconfig/aconfig/templates/FeatureFlags.java.template
index 38c8f13..d2799b2 100644
--- a/tools/aconfig/aconfig/templates/FeatureFlags.java.template
+++ b/tools/aconfig/aconfig/templates/FeatureFlags.java.template
@@ -19,4 +19,4 @@
{{ -endif }}
boolean {item.method_name}();
{{ -endfor }}
-}
\ No newline at end of file
+}
diff --git a/tools/aconfig/aconfig/templates/FeatureFlagsImpl.java.template b/tools/aconfig/aconfig/templates/FeatureFlagsImpl.java.template
index d1cf191..26d3069 100644
--- a/tools/aconfig/aconfig/templates/FeatureFlagsImpl.java.template
+++ b/tools/aconfig/aconfig/templates/FeatureFlagsImpl.java.template
@@ -36,18 +36,19 @@
{{ if not library_exported }}
private void init() \{
StorageInternalReader reader = null;
+ boolean foundPackage = true;
try \{
reader = new StorageInternalReader("{container}", "{package_name}");
-{{ for namespace_with_flags in namespace_flags }}
-{{ -for flag in namespace_with_flags.flags }}
-{{ if flag.is_read_write }}
- {flag.method_name} = reader.getBooleanFlagValue({flag.flag_offset});
-{{ endif }}
-{{ -endfor }}
-{{ -endfor }}
} catch (Exception e) \{
- throw new RuntimeException("Cannot read flag in codegen", e);
+ foundPackage = false;
}
+ {{ for namespace_with_flags in namespace_flags }}
+ {{ -for flag in namespace_with_flags.flags }}
+ {{ if flag.is_read_write }}
+ {flag.method_name} = foundPackage ? reader.getBooleanFlagValue({flag.flag_offset}) : {flag.default_value};
+ {{ endif }}
+ {{ -endfor }}
+ {{ -endfor }}
isCached = true;
}
{{ endif }}
diff --git a/tools/aconfig/aconfig/templates/cpp_source_file.template b/tools/aconfig/aconfig/templates/cpp_source_file.template
index 852b905..eaaf86f 100644
--- a/tools/aconfig/aconfig/templates/cpp_source_file.template
+++ b/tools/aconfig/aconfig/templates/cpp_source_file.template
@@ -76,7 +76,8 @@
: boolean_start_index_()
{{ -endif }}
, flag_value_file_(nullptr)
- , read_from_new_storage_(false) \{
+ , read_from_new_storage_(false)
+ , package_exists_in_storage_(true) \{
if (access("/metadata/aconfig/boot/enable_only_new_storage", F_OK) == 0) \{
read_from_new_storage_ = true;
@@ -99,6 +100,11 @@
ALOGE("error: failed to get package read context: %s", context.error().c_str());
}
+ if (!(context->package_exists)) \{
+ package_exists_in_storage_ = false;
+ return;
+ }
+
// cache package boolean flag start index
boolean_start_index_ = context->boolean_start_index;
@@ -126,6 +132,10 @@
if (cache_[{item.readwrite_idx}] == -1) \{
{{ if allow_instrumentation- }}
if (read_from_new_storage_) \{
+ if (!package_exists_in_storage_) \{
+ return {item.default_value};
+ }
+
auto value = aconfig_storage::get_boolean_flag_value(
*flag_value_file_,
boolean_start_index_ + {item.flag_offset});
@@ -168,6 +178,8 @@
std::unique_ptr<aconfig_storage::MappedStorageFile> flag_value_file_;
bool read_from_new_storage_;
+
+ bool package_exists_in_storage_;
{{ -endif }}
{{ -endif }}
diff --git a/tools/aconfig/aconfig/templates/rust.template b/tools/aconfig/aconfig/templates/rust.template
index c2f162f..6456360 100644
--- a/tools/aconfig/aconfig/templates/rust.template
+++ b/tools/aconfig/aconfig/templates/rust.template
@@ -51,7 +51,10 @@
get_boolean_flag_value(&flag_val_map, offset + {flag.flag_offset})
.map_err(|err| format!("failed to get flag: \{err}"))
},
- None => Err("no context found for package '{package}'".to_string())
+ None => \{
+ log!(Level::Error, "no context found for package {package}");
+ Ok({flag.default_value})
+ }
}
})
});
diff --git a/tools/aconfig/aconfig_storage_read_api/src/lib.rs b/tools/aconfig/aconfig_storage_read_api/src/lib.rs
index 884f148..ab066c6 100644
--- a/tools/aconfig/aconfig_storage_read_api/src/lib.rs
+++ b/tools/aconfig/aconfig_storage_read_api/src/lib.rs
@@ -44,6 +44,7 @@
pub use aconfig_storage_file::{AconfigStorageError, FlagValueType, StorageFileType};
pub use flag_table_query::FlagReadContext;
+pub use mapped_file::map_file;
pub use package_table_query::PackageReadContext;
use aconfig_storage_file::read_u32_from_bytes;
diff --git a/tools/aconfig/aconfig_storage_read_api/src/mapped_file.rs b/tools/aconfig/aconfig_storage_read_api/src/mapped_file.rs
index 32dbed8..2c1884a 100644
--- a/tools/aconfig/aconfig_storage_read_api/src/mapped_file.rs
+++ b/tools/aconfig/aconfig_storage_read_api/src/mapped_file.rs
@@ -28,7 +28,7 @@
/// The memory mapped file may have undefined behavior if there are writes to this
/// file after being mapped. Ensure no writes can happen to this file while this
/// mapping stays alive.
-unsafe fn map_file(file_path: &str) -> Result<Mmap, AconfigStorageError> {
+pub unsafe fn map_file(file_path: &str) -> Result<Mmap, AconfigStorageError> {
let file = File::open(file_path)
.map_err(|errmsg| FileReadFail(anyhow!("Failed to open file {}: {}", file_path, errmsg)))?;
unsafe {
diff --git a/tools/aconfig/aconfig_storage_write_api/Android.bp b/tools/aconfig/aconfig_storage_write_api/Android.bp
index 0f1962c..4c882b4 100644
--- a/tools/aconfig/aconfig_storage_write_api/Android.bp
+++ b/tools/aconfig/aconfig_storage_write_api/Android.bp
@@ -16,6 +16,11 @@
"libaconfig_storage_file",
"libaconfig_storage_read_api",
],
+ min_sdk_version: "34",
+ apex_available: [
+ "//apex_available:anyapex",
+ "//apex_available:platform",
+ ],
}
rust_library {
diff --git a/tools/aconfig/aflags/Cargo.toml b/tools/aconfig/aflags/Cargo.toml
index 7efce6d..d31e232 100644
--- a/tools/aconfig/aflags/Cargo.toml
+++ b/tools/aconfig/aflags/Cargo.toml
@@ -9,10 +9,10 @@
protobuf = "3.2.0"
regex = "1.10.3"
aconfig_protos = { path = "../aconfig_protos" }
-aconfigd_protos = { version = "0.1.0", path = "../../../../../system/server_configurable_flags/aconfigd"}
+aconfigd_protos = { version = "0.1.0", path = "../../../../../packages/modules/ConfigInfrastructure/aconfigd/proto"}
nix = { version = "0.28.0", features = ["user"] }
aconfig_storage_file = { version = "0.1.0", path = "../aconfig_storage_file" }
aconfig_storage_read_api = { version = "0.1.0", path = "../aconfig_storage_read_api" }
clap = {version = "4.5.2" }
aconfig_device_paths = { version = "0.1.0", path = "../aconfig_device_paths" }
-aconfig_flags = { version = "0.1.0", path = "../aconfig_flags" }
\ No newline at end of file
+aconfig_flags = { version = "0.1.0", path = "../aconfig_flags" }
diff --git a/tools/compliance/go.work b/tools/compliance/go.work
index a24d2ea..506e619 100644
--- a/tools/compliance/go.work
+++ b/tools/compliance/go.work
@@ -1,4 +1,4 @@
-go 1.22
+go 1.23
use (
.
diff --git a/tools/edit_monitor/daemon_manager.py b/tools/edit_monitor/daemon_manager.py
index 445d849..892c292 100644
--- a/tools/edit_monitor/daemon_manager.py
+++ b/tools/edit_monitor/daemon_manager.py
@@ -70,6 +70,10 @@
logging.warning("Block sign found, exiting...")
return
+ if self.binary_path.startswith('/google/cog/'):
+ logging.warning("Edit monitor for cog is not supported, exiting...")
+ return
+
self._stop_any_existing_instance()
self._write_pid_to_pidfile()
self._start_daemon_process()
diff --git a/tools/edit_monitor/daemon_manager_test.py b/tools/edit_monitor/daemon_manager_test.py
index d62eade..72442c6 100644
--- a/tools/edit_monitor/daemon_manager_test.py
+++ b/tools/edit_monitor/daemon_manager_test.py
@@ -131,6 +131,13 @@
# Verify no daemon process is started.
self.assertIsNone(dm.daemon_process)
+ def test_start_return_directly_if_in_cog_env(self):
+ dm = daemon_manager.DaemonManager(
+ '/google/cog/cloud/user/workspace/edit_monitor')
+ dm.start()
+ # Verify no daemon process is started.
+ self.assertIsNone(dm.daemon_process)
+
@mock.patch('os.kill')
def test_start_failed_to_kill_existing_instance(self, mock_kill):
mock_kill.side_effect = OSError('Unknown OSError')
diff --git a/tools/filelistdiff/file_list_diff.py b/tools/filelistdiff/file_list_diff.py
index 951325f..fbbfedf 100644
--- a/tools/filelistdiff/file_list_diff.py
+++ b/tools/filelistdiff/file_list_diff.py
@@ -31,10 +31,14 @@
allowed_files.update(set(filter(lambda x: len(x), map(lambda x: x.lstrip().split('#',1)[0].rstrip() , allowlist_file.read().split('\n')))))
def is_unknown_diff(filepath):
- return not filepath in allowed_files
+ return filepath not in allowed_files
+
+ def is_unnecessary_allowlist(filepath):
+ return filepath not in kati_files.symmetric_difference(soong_files)
unique_in_kati = set(filter(is_unknown_diff, kati_files - soong_files))
unique_in_soong = set(filter(is_unknown_diff, soong_files - kati_files))
+ unnecessary_allowlists = set(filter(is_unnecessary_allowlist, allowed_files))
if unique_in_kati:
print('')
@@ -53,7 +57,15 @@
for item in sorted(unique_in_soong):
print(' '+item)
- if unique_in_kati or unique_in_soong:
+ if unnecessary_allowlists:
+ print('')
+ print(f'{COLOR_ERROR}Unnecessary files in allowlist.{COLOR_NORMAL}')
+ print('Please remove these entries from build/make/tools/filelistdiff/allowlist')
+ for item in sorted(unnecessary_allowlists):
+ print(' '+item)
+
+
+ if unique_in_kati or unique_in_soong or unnecessary_allowlists:
print('')
sys.exit(1)
diff --git a/tools/ide_query/ide_query.go b/tools/ide_query/ide_query.go
index 89ac78f..ec937fe 100644
--- a/tools/ide_query/ide_query.go
+++ b/tools/ide_query/ide_query.go
@@ -341,6 +341,8 @@
Id: moduleName,
Language: pb.Language_LANGUAGE_JAVA,
SourceFilePaths: m.Srcs,
+ GeneratedFiles: genFiles(env, m),
+ DependencyIds: m.Deps,
}
unitsById[u.Id] = u
@@ -355,14 +357,10 @@
continue
}
- var paths []string
- paths = append(paths, mod.Srcs...)
- paths = append(paths, mod.SrcJars...)
- paths = append(paths, mod.Jars...)
unitsById[name] = &pb.BuildableUnit{
Id: name,
SourceFilePaths: mod.Srcs,
- GeneratedFiles: genFiles(env, paths),
+ GeneratedFiles: genFiles(env, mod),
DependencyIds: mod.Deps,
}
@@ -380,8 +378,13 @@
}
// genFiles returns the generated files (paths that start with outDir/) for the
-// given paths. Generated files that do not exist are ignored.
-func genFiles(env Env, paths []string) []*pb.GeneratedFile {
+// given module. Generated files that do not exist are ignored.
+func genFiles(env Env, mod *javaModule) []*pb.GeneratedFile {
+ var paths []string
+ paths = append(paths, mod.Srcs...)
+ paths = append(paths, mod.SrcJars...)
+ paths = append(paths, mod.Jars...)
+
prefix := env.OutDir + "/"
var ret []*pb.GeneratedFile
for _, p := range paths {