Merge "Don't pack target tests into art-host-tests.zip." into main
diff --git a/ci/build_test_suites.py b/ci/build_test_suites.py
index 75dd9f2..deb1f1d 100644
--- a/ci/build_test_suites.py
+++ b/ci/build_test_suites.py
@@ -81,6 +81,7 @@
build_targets = set()
packaging_functions = set()
+ self.file_download_options = self._aggregate_file_download_options()
for target in self.args.extra_targets:
if self._unused_target_exclusion_enabled(
target
@@ -107,49 +108,24 @@
def _build_target_used(self, target: str) -> bool:
"""Determines whether this target's outputs are used by the test configurations listed in the build context."""
- file_download_regexes = self._aggregate_file_download_regexes()
# For all of a targets' outputs, check if any of the regexes used by tests
# to download artifacts would match it. If any of them do then this target
# is necessary.
- for artifact in self._get_target_potential_outputs(target):
- for regex in file_download_regexes:
- if re.match(regex, artifact):
- return True
- return False
+ regex = r'\b(%s)\b' % re.escape(target)
+ return any(re.search(regex, opt) for opt in self.file_download_options)
- def _get_target_potential_outputs(self, target: str) -> set[str]:
- tests_suffix = '-tests'
- if target.endswith('tests'):
- tests_suffix = ''
- # This is a list of all the potential zips output by the test suite targets.
- # If the test downloads artifacts from any of these zips, we will be
- # conservative and avoid skipping the tests.
- return {
- f'{target}.zip',
- f'android-{target}.zip',
- f'android-{target}-verifier.zip',
- f'{target}{tests_suffix}_list.zip',
- f'android-{target}{tests_suffix}_list.zip',
- f'{target}{tests_suffix}_host-shared-libs.zip',
- f'android-{target}{tests_suffix}_host-shared-libs.zip',
- f'{target}{tests_suffix}_configs.zip',
- f'android-{target}{tests_suffix}_configs.zip',
- }
-
- def _aggregate_file_download_regexes(self) -> set[re.Pattern]:
+ def _aggregate_file_download_options(self) -> set[str]:
"""Lists out all test config options to specify targets to download.
These come in the form of regexes.
"""
- all_regexes = set()
+ all_options = set()
for test_info in self._get_test_infos():
for opt in test_info.get('extraOptions', []):
# check the known list of options for downloading files.
if opt.get('key') in self._DOWNLOAD_OPTS:
- all_regexes.update(
- re.compile(value) for value in opt.get('values', [])
- )
- return all_regexes
+ all_options.update(opt.get('values', []))
+ return all_options
def _get_test_infos(self):
return self.build_context.get('testContext', dict()).get('testInfos', [])
diff --git a/ci/build_test_suites_test.py b/ci/build_test_suites_test.py
index 25c072e..463bdd0 100644
--- a/ci/build_test_suites_test.py
+++ b/ci/build_test_suites_test.py
@@ -380,6 +380,25 @@
self.assertSetEqual(build_plan.build_targets, set())
+ def test_target_regex_matching_not_too_broad(self):
+ build_target = 'test_target'
+ test_context = self.get_test_context(build_target)
+ test_context['testInfos'][0]['extraOptions'] = [{
+ 'key': 'additional-files-filter',
+ 'values': [f'.*a{build_target}.*\.zip'],
+ }]
+ build_planner = self.create_build_planner(
+ build_targets={build_target},
+ build_context=self.create_build_context(
+ test_context=test_context,
+ enabled_build_features={'test_target_unused_exclusion'},
+ ),
+ )
+
+ build_plan = build_planner.create_build_plan()
+
+ self.assertSetEqual(build_plan.build_targets, set())
+
def create_build_planner(
self,
build_targets: set[str],
diff --git a/core/Makefile b/core/Makefile
index 96588e3..18ee77d 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -1267,9 +1267,8 @@
endif
-
+# The value of RAMDISK_NODE_LIST is defined in system/core/rootdir/Android.bp.
# This file contains /dev nodes description added to the generic ramdisk
-RAMDISK_NODE_LIST := $(PRODUCT_OUT)/ramdisk_node_list
# We just build this directly to the install location.
INSTALLED_RAMDISK_TARGET := $(BUILT_RAMDISK_TARGET)
@@ -5136,6 +5135,7 @@
$(TARGET_OUT)/apex/% \
$(TARGET_OUT_SYSTEM_EXT)/apex/% \
$(TARGET_OUT_VENDOR)/apex/% \
+ $(TARGET_OUT_ODM)/apex/% \
$(TARGET_OUT_PRODUCT)/apex/% \
apex_files := $(sort $(filter $(apex_dirs), $(INTERNAL_ALLIMAGES_FILES)))
@@ -5188,6 +5188,7 @@
$(TARGET_OUT_PRODUCT)/apex/% \
$(TARGET_OUT_SYSTEM_EXT)/apex/% \
$(TARGET_OUT_VENDOR)/apex/% \
+ $(TARGET_OUT_ODM)/apex/% \
apex_files := $(sort $(filter $(apex_dirs), $(INTERNAL_ALLIMAGES_FILES)))
@@ -5206,6 +5207,7 @@
--system_ext_path $(TARGET_OUT_SYSTEM_EXT) \
--product_path $(TARGET_OUT_PRODUCT) \
--vendor_path $(TARGET_OUT_VENDOR) \
+ --odm_path $(TARGET_OUT_ODM) \
--apex_path $(APEX_OUT)
apex_files :=
@@ -6883,6 +6885,33 @@
$(hide) echo "$(BOARD_KERNEL_PAGESIZE)" > $(zip_root)/INIT_BOOT/pagesize
endif # BOARD_KERNEL_PAGESIZE
endif # BUILDING_INIT_BOOT_IMAGE
+ifdef BOARD_EROFS_COMPRESS_HINTS
+ $(hide) cp $(BOARD_EROFS_COMPRESS_HINTS) $(zip_root)/META/erofs_default_compress_hints.txt
+endif
+ifdef BOARD_SYSTEMIMAGE_EROFS_COMPRESS_HINTS
+ $(hide) cp $(BOARD_SYSTEMIMAGE_EROFS_COMPRESS_HINTS) $(zip_root)/META/system_erofs_compress_hints.txt
+endif
+ifdef BOARD_SYSTEM_EXTIMAGE_EROFS_COMPRESS_HINTS
+ $(hide) cp $(BOARD_SYSTEM_EXTIMAGE_EROFS_COMPRESS_HINTS) $(zip_root)/META/system_ext_erofs_compress_hints.txt
+endif
+ifdef BOARD_PRODUCTIMAGE_EROFS_COMPRESS_HINTS
+ $(hide) cp $(BOARD_PRODUCTIMAGE_EROFS_COMPRESS_HINTS) $(zip_root)/META/product_erofs_compress_hints.txt
+endif
+ifdef BOARD_VENDORIMAGE_EROFS_COMPRESS_HINTS
+ $(hide) cp $(BOARD_VENDORIMAGE_EROFS_COMPRESS_HINTS) $(zip_root)/META/vendor_erofs_compress_hints.txt
+endif
+ifdef BOARD_ODMIMAGE_EROFS_COMPRESS_HINTS
+ $(hide) cp $(BOARD_ODMIMAGE_EROFS_COMPRESS_HINTS) $(zip_root)/META/odm_erofs_compress_hints.txt
+endif
+ifdef BOARD_VENDOR_DLKMIMAGE_EROFS_COMPRESS_HINTS
+ $(hide) cp $(BOARD_VENDOR_DLKMIMAGE_EROFS_COMPRESS_HINTS) $(zip_root)/META/vendor_dlkm_erofs_compress_hints.txt
+endif
+ifdef BOARD_ODM_DLKMIMAGE_EROFS_COMPRESS_HINTS
+ $(hide) cp $(BOARD_ODM_DLKMIMAGE_EROFS_COMPRESS_HINTS) $(zip_root)/META/odm_dlkm_erofs_compress_hints.txt
+endif
+ifdef BOARD_SYSTEM_DLKMIMAGE_EROFS_COMPRESS_HINTS
+ $(hide) cp $(BOARD_SYSTEM_DLKMIMAGE_EROFS_COMPRESS_HINTS) $(zip_root)/META/system_dlkm_erofs_compress_hints.txt
+endif
ifneq ($(INSTALLED_VENDOR_BOOTIMAGE_TARGET),)
$(call fs_config,$(zip_root)/VENDOR_BOOT/RAMDISK,) > $(zip_root)/META/vendor_boot_filesystem_config.txt
endif
@@ -7885,10 +7914,11 @@
$(PACKED_IMAGE_ARCHIVE_TARGET): $(PACK_IMAGE_TARGET) | $(GZIP)
$(GZIP) -fk $(PACK_IMAGE_TARGET)
-droidcore-unbundled: $(PACKED_IMAGE_ARCHIVE_TARGET)
-
$(call dist-for-goals,dist_files,$(PACKED_IMAGE_ARCHIVE_TARGET))
+.PHONY: pack-image
+pack-image: $(PACK_IMAGE_TARGET)
+
endif # PACK_DESKTOP_FILESYSTEM_IMAGES
# -----------------------------------------------------------------
@@ -7904,10 +7934,11 @@
$(PACKED_RECOVERY_IMAGE_ARCHIVE_TARGET): $(PACK_RECOVERY_IMAGE_TARGET) | $(GZIP)
$(GZIP) -fk $(PACK_RECOVERY_IMAGE_TARGET)
-droidcore-unbundled: $(PACKED_RECOVERY_IMAGE_ARCHIVE_TARGET)
-
$(call dist-for-goals,dist_files,$(PACKED_RECOVERY_IMAGE_ARCHIVE_TARGET))
+.PHONY: pack-recovery-image
+pack-recovery-image: $(PACK_RECOVERY_IMAGE_TARGET)
+
endif # PACK_DESKTOP_RECOVERY_IMAGE
# -----------------------------------------------------------------
diff --git a/core/android_soong_config_vars.mk b/core/android_soong_config_vars.mk
index 915f55f..5fc8fd4 100644
--- a/core/android_soong_config_vars.mk
+++ b/core/android_soong_config_vars.mk
@@ -71,11 +71,6 @@
endif
endif
-# TODO(b/308187800): some internal modules set `prefer` to true on the prebuilt apex module,
-# and set that to false when `ANDROID.module_build_from_source` is true.
-# Set this soong config variable to true for now, and cleanup `prefer` as part of b/308187800
-$(call add_soong_config_var_value,ANDROID,module_build_from_source,true)
-
# Enable SystemUI optimizations by default unless explicitly set.
SYSTEMUI_OPTIMIZE_JAVA ?= true
$(call add_soong_config_var,ANDROID,SYSTEMUI_OPTIMIZE_JAVA)
diff --git a/core/base_rules.mk b/core/base_rules.mk
index 1135003..5363e0f 100644
--- a/core/base_rules.mk
+++ b/core/base_rules.mk
@@ -340,7 +340,7 @@
ifneq (,$(LOCAL_SOONG_INSTALLED_MODULE))
ifneq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK))
- $(call pretty-error, LOCAL_SOONG_INSTALLED_MODULE can only be used from $(SOONG_ANDROID_MK))
+ $(call pretty-error, LOCAL_MODULE_MAKEFILE can only be used from $(SOONG_ANDROID_MK))
endif
# Use the install path requested by Soong.
LOCAL_INSTALLED_MODULE := $(LOCAL_SOONG_INSTALLED_MODULE)
diff --git a/core/config.mk b/core/config.mk
index 2f18add..0ecee8a 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -1266,8 +1266,15 @@
# consistency with those defined in BoardConfig.mk files.
include $(BUILD_SYSTEM)/android_soong_config_vars.mk
-SOONG_VARIABLES := $(SOONG_OUT_DIR)/soong.$(TARGET_PRODUCT).variables
-SOONG_EXTRA_VARIABLES := $(SOONG_OUT_DIR)/soong.$(TARGET_PRODUCT).extra.variables
+# EMMA_INSTRUMENT is set to true when coverage is enabled. Creates a suffix to
+# differeciate the coverage version of ninja files. This will save 5 minutes of
+# build time used to regenerate ninja.
+ifeq (true,$(EMMA_INSTRUMENT))
+COVERAGE_SUFFIX := .coverage
+endif
+
+SOONG_VARIABLES := $(SOONG_OUT_DIR)/soong.$(TARGET_PRODUCT)$(COVERAGE_SUFFIX).variables
+SOONG_EXTRA_VARIABLES := $(SOONG_OUT_DIR)/soong.$(TARGET_PRODUCT)$(COVERAGE_SUFFIX).extra.variables
ifeq ($(CALLED_FROM_SETUP),true)
include $(BUILD_SYSTEM)/ninja_config.mk
diff --git a/core/dex_preopt_config.mk b/core/dex_preopt_config.mk
index d51de33..f1e9fb5 100644
--- a/core/dex_preopt_config.mk
+++ b/core/dex_preopt_config.mk
@@ -1,4 +1,4 @@
-DEX_PREOPT_CONFIG := $(SOONG_OUT_DIR)/dexpreopt.config
+DEX_PREOPT_CONFIG := $(SOONG_OUT_DIR)/dexpreopt${COVERAGE_SUFFIX}.config
ENABLE_PREOPT := true
ENABLE_PREOPT_BOOT_IMAGES := true
diff --git a/core/java_prebuilt_internal.mk b/core/java_prebuilt_internal.mk
index 46393ac..4b6eea7 100644
--- a/core/java_prebuilt_internal.mk
+++ b/core/java_prebuilt_internal.mk
@@ -172,6 +172,12 @@
endif
endif
+# transitive-res-packages is only populated for Soong modules for now, but needs
+# to exist so that other Make modules can depend on it. Create an empty file.
+my_transitive_res_packages := $(intermediates.COMMON)/transitive-res-packages
+$(my_transitive_res_packages):
+ touch $@
+
my_res_package := $(intermediates.COMMON)/package-res.apk
# We needed only very few PRIVATE variables and aapt2.mk input variables. Reset the unnecessary ones.
diff --git a/core/main.mk b/core/main.mk
index 27ba526..85fd65c 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -31,8 +31,7 @@
.KATI_READONLY := $(foreach n,$(SOONG_CONFIG_NAMESPACES),SOONG_CONFIG_$(n))
.KATI_READONLY := $(foreach n,$(SOONG_CONFIG_NAMESPACES),$(foreach k,$(SOONG_CONFIG_$(n)),SOONG_CONFIG_$(n)_$(k)))
-include $(SOONG_MAKEVARS_MK)
-
+include $(SOONG_OUT_DIR)/make_vars-$(TARGET_PRODUCT)$(COVERAGE_SUFFIX).mk
YACC :=$= $(BISON) -d
include $(BUILD_SYSTEM)/clang/config.mk
@@ -276,12 +275,15 @@
# Include all of the makefiles in the system
#
-subdir_makefiles := $(SOONG_OUT_DIR)/installs-$(TARGET_PRODUCT).mk $(SOONG_ANDROID_MK)
+subdir_makefiles := $(SOONG_OUT_DIR)/installs-$(TARGET_PRODUCT)$(COVERAGE_SUFFIX).mk $(SOONG_ANDROID_MK)
+
# Android.mk files are only used on Linux builds, Mac only supports Android.bp
ifeq ($(HOST_OS),linux)
subdir_makefiles += $(file <$(OUT_DIR)/.module_paths/Android.mk.list)
endif
-subdir_makefiles += $(SOONG_OUT_DIR)/late-$(TARGET_PRODUCT).mk
+
+subdir_makefiles += $(SOONG_OUT_DIR)/late-$(TARGET_PRODUCT)$(COVERAGE_SUFFIX).mk
+
subdir_makefiles_total := $(words int $(subdir_makefiles) post finish)
.KATI_READONLY := subdir_makefiles_total
diff --git a/core/product_config.rbc b/core/product_config.rbc
index 59e2c95..20344f4 100644
--- a/core/product_config.rbc
+++ b/core/product_config.rbc
@@ -382,6 +382,11 @@
_soong_config_namespace(g, nsname)
g[_soong_config_namespaces_key][nsname][var]=_mkstrip(value)
+def _soong_config_set_bool(g, nsname, var, value):
+ """Assigns the value to the variable in the namespace, and marks it as a boolean."""
+ _soong_config_set(g, nsname, var, _filter("true", value))
+ g["SOONG_CONFIG_TYPE_%s_%s" % (nsname, var)] = "bool"
+
def _soong_config_append(g, nsname, var, value):
"""Appends to the value of the variable in the namespace."""
_soong_config_namespace(g, nsname)
@@ -861,6 +866,7 @@
soong_config_namespace = _soong_config_namespace,
soong_config_append = _soong_config_append,
soong_config_set = _soong_config_set,
+ soong_config_set_bool = _soong_config_set_bool,
soong_config_get = _soong_config_get,
abspath = _abspath,
add_product_dex_preopt_module_config = _add_product_dex_preopt_module_config,
diff --git a/core/soong_config.mk b/core/soong_config.mk
index 37601a1..f2e2283 100644
--- a/core/soong_config.mk
+++ b/core/soong_config.mk
@@ -1,5 +1,5 @@
-SOONG_MAKEVARS_MK := $(SOONG_OUT_DIR)/make_vars-$(TARGET_PRODUCT).mk
-SOONG_ANDROID_MK := $(SOONG_OUT_DIR)/Android-$(TARGET_PRODUCT).mk
+SOONG_MAKEVARS_MK := $(SOONG_OUT_DIR)/make_vars-$(TARGET_PRODUCT)$(COVERAGE_SUFFIX).mk
+SOONG_ANDROID_MK := $(SOONG_OUT_DIR)/Android-$(TARGET_PRODUCT)$(COVERAGE_SUFFIX).mk
include $(BUILD_SYSTEM)/art_config.mk
include $(BUILD_SYSTEM)/dex_preopt_config.mk
@@ -26,7 +26,7 @@
$(shell mkdir -p $(dir $(SOONG_VARIABLES)))
$(call json_start)
-$(call add_json_str, Make_suffix, -$(TARGET_PRODUCT))
+$(call add_json_str, Make_suffix, -$(TARGET_PRODUCT)$(COVERAGE_SUFFIX))
$(call add_json_str, BuildId, $(BUILD_ID))
$(call add_json_str, BuildFingerprintFile, build_fingerprint.txt)
@@ -355,6 +355,11 @@
$(call add_json_str, EnableUffdGc, $(_config_enable_uffd_gc))
_config_enable_uffd_gc :=
+$(call add_json_list, DeviceFrameworkCompatibilityMatrixFile, $(DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE))
+$(call add_json_list, DeviceProductCompatibilityMatrixFile, $(DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE))
+$(call add_json_list, BoardAvbSystemAddHashtreeFooterArgs, $(BOARD_AVB_SYSTEM_ADD_HASHTREE_FOOTER_ARGS))
+$(call add_json_bool, BoardAvbEnable, $(filter true,$(BOARD_AVB_ENABLE)))
+
$(call json_end)
$(file >$(SOONG_VARIABLES).tmp,$(json_contents))
diff --git a/target/product/large_screen_common.mk b/target/product/large_screen_common.mk
new file mode 100644
index 0000000..3eb9ff0
--- /dev/null
+++ b/target/product/large_screen_common.mk
@@ -0,0 +1,21 @@
+# 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.
+#
+
+# Window Extensions
+$(call inherit-product, $(SRC_TARGET_DIR)/product/window_extensions.mk)
+
+# Enable Settings 2-pane optimization for large-screen
+PRODUCT_SYSTEM_PROPERTIES += \
+ persist.settings.large_screen_opt.enabled=true
diff --git a/teams/Android.bp b/teams/Android.bp
index a9699d2..94585fc 100644
--- a/teams/Android.bp
+++ b/teams/Android.bp
@@ -4414,8 +4414,29 @@
}
team {
+ name: "trendy_team_android_media_solutions_playback",
+
+ // go/trendy/manage/engineers/6742515252559872
+ trendy_team_id: "6742515252559872",
+}
+
+team {
name: "trendy_team_android_telemetry_client_infra",
// go/trendy/manage/engineers/5403245077430272
trendy_team_id: "5403245077430272",
}
+
+team {
+ name: "trendy_team_pte_sysui",
+
+ // go/trendy/manage/engineers/5185897463382016
+ trendy_team_id: "5185897463382016",
+}
+
+team {
+ name: "trendy_team_pixel_troubleshooting_app",
+
+ // go/trendy/manage/engineers/5097003746426880
+ trendy_team_id: "5097003746426880",
+}
diff --git a/tools/aconfig/aconfig/src/codegen/java.rs b/tools/aconfig/aconfig/src/codegen/java.rs
index a74ef85..dbc4ab5 100644
--- a/tools/aconfig/aconfig/src/codegen/java.rs
+++ b/tools/aconfig/aconfig/src/codegen/java.rs
@@ -698,6 +698,8 @@
StorageInternalReader reader;
boolean readFromNewStorage;
+ boolean useNewStorageValueAndDiscardOld = false;
+
private final static String TAG = "AconfigJavaCodegen";
private final static String SUCCESS_LOG = "success: %s value matches";
private final static String MISMATCH_LOG = "error: %s value mismatch, new storage value is %s, old storage value is %s";
@@ -713,6 +715,9 @@
reader = null;
}
}
+
+ useNewStorageValueAndDiscardOld =
+ DeviceConfig.getBoolean("core_experiments_team_internal", "com.android.providers.settings.use_new_storage_value", false);
}
private void load_overrides_aconfig_test() {
@@ -746,7 +751,7 @@
Log.i(TAG, String.format(MISMATCH_LOG, "disabledRw", val, disabledRw));
}
- if (DeviceConfig.getBoolean("core_experiments_team_internal", "com.android.providers.settings.use_new_storage_value", false)) {
+ if (useNewStorageValueAndDiscardOld) {
disabledRw = val;
}
@@ -757,7 +762,7 @@
Log.i(TAG, String.format(MISMATCH_LOG, "disabledRwExported", val, disabledRwExported));
}
- if (DeviceConfig.getBoolean("core_experiments_team_internal", "com.android.providers.settings.use_new_storage_value", false)) {
+ if (useNewStorageValueAndDiscardOld) {
disabledRwExported = val;
}
@@ -768,7 +773,7 @@
Log.i(TAG, String.format(MISMATCH_LOG, "enabledRw", val, enabledRw));
}
- if (DeviceConfig.getBoolean("core_experiments_team_internal", "com.android.providers.settings.use_new_storage_value", false)) {
+ if (useNewStorageValueAndDiscardOld) {
enabledRw = val;
}
@@ -805,7 +810,7 @@
Log.i(TAG, String.format(MISMATCH_LOG, "disabledRwInOtherNamespace", val, disabledRwInOtherNamespace));
}
- if (DeviceConfig.getBoolean("core_experiments_team_internal", "com.android.providers.settings.use_new_storage_value", false)) {
+ if (useNewStorageValueAndDiscardOld) {
disabledRwInOtherNamespace = val;
}
diff --git a/tools/aconfig/aconfig/templates/FeatureFlagsImpl.java.template b/tools/aconfig/aconfig/templates/FeatureFlagsImpl.java.template
index 96e7623..9970b1f 100644
--- a/tools/aconfig/aconfig/templates/FeatureFlagsImpl.java.template
+++ b/tools/aconfig/aconfig/templates/FeatureFlagsImpl.java.template
@@ -35,6 +35,8 @@
StorageInternalReader reader;
boolean readFromNewStorage;
+ boolean useNewStorageValueAndDiscardOld = false;
+
private final static String TAG = "AconfigJavaCodegen";
private final static String SUCCESS_LOG = "success: %s value matches";
private final static String MISMATCH_LOG = "error: %s value mismatch, new storage value is %s, old storage value is %s";
@@ -50,6 +52,9 @@
reader = null;
}
}
+
+ useNewStorageValueAndDiscardOld =
+ DeviceConfig.getBoolean("core_experiments_team_internal", "com.android.providers.settings.use_new_storage_value", false);
}
{{ -endif }}
@@ -91,7 +96,7 @@
Log.i(TAG, String.format(MISMATCH_LOG, "{flag.method_name}", val, {flag.method_name}));
}
- if (DeviceConfig.getBoolean("core_experiments_team_internal", "com.android.providers.settings.use_new_storage_value", false)) \{
+ if (useNewStorageValueAndDiscardOld) \{
{flag.method_name} = val;
}
diff --git a/tools/aconfig/aconfig_device_paths/Android.bp b/tools/aconfig/aconfig_device_paths/Android.bp
index 2d943de..95cecf4 100644
--- a/tools/aconfig/aconfig_device_paths/Android.bp
+++ b/tools/aconfig/aconfig_device_paths/Android.bp
@@ -39,8 +39,8 @@
genrule {
name: "libaconfig_java_device_paths_src",
- srcs: ["src/DevicePathsTemplate.java"],
- out: ["DevicePaths.java"],
+ srcs: ["src/DeviceProtosTemplate.java"],
+ out: ["DeviceProtos.java"],
tool_files: ["partition_aconfig_flags_paths.txt"],
cmd: "sed -e '/TEMPLATE/{r$(location partition_aconfig_flags_paths.txt)' -e 'd}' $(in) > $(out)",
}
@@ -48,5 +48,7 @@
java_library {
name: "aconfig_device_paths_java",
srcs: [":libaconfig_java_device_paths_src"],
- sdk_version: "core_current",
+ static_libs: [
+ "libaconfig_java_proto_nano",
+ ],
}
diff --git a/tools/aconfig/aconfig_device_paths/src/DevicePathsTemplate.java b/tools/aconfig/aconfig_device_paths/src/DeviceProtosTemplate.java
similarity index 62%
rename from tools/aconfig/aconfig_device_paths/src/DevicePathsTemplate.java
rename to tools/aconfig/aconfig_device_paths/src/DeviceProtosTemplate.java
index 16355a3..58c58de 100644
--- a/tools/aconfig/aconfig_device_paths/src/DevicePathsTemplate.java
+++ b/tools/aconfig/aconfig_device_paths/src/DeviceProtosTemplate.java
@@ -15,7 +15,12 @@
*/
package android.aconfig;
+import android.aconfig.nano.Aconfig.parsed_flag;
+import android.aconfig.nano.Aconfig.parsed_flags;
+
import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -23,7 +28,7 @@
/**
* @hide
*/
-public class DevicePaths {
+public class DeviceProtos {
static final String[] PATHS = {
TEMPLATE
};
@@ -31,12 +36,35 @@
private static final String APEX_DIR = "/apex";
private static final String APEX_ACONFIG_PATH_SUFFIX = "/etc/aconfig_flags.pb";
+ /**
+ * Returns a list of all on-device aconfig protos.
+ *
+ * May throw an exception if the protos can't be read at the call site. For
+ * example, some of the protos are in the apex/ partition, which is mounted
+ * somewhat late in the boot process.
+ *
+ * @throws IOException if we can't read one of the protos yet
+ * @return a list of all on-device aconfig protos
+ */
+ public static List<parsed_flag> loadAndParseFlagProtos() throws IOException {
+ ArrayList<parsed_flag> result = new ArrayList();
+
+ for (String path : parsedFlagsProtoPaths()) {
+ FileInputStream inputStream = new FileInputStream(path);
+ parsed_flags parsedFlags = parsed_flags.parseFrom(inputStream.readAllBytes());
+ for (parsed_flag flag : parsedFlags.parsedFlag) {
+ result.add(flag);
+ }
+ }
+
+ return result;
+ }
/**
* Returns the list of all on-device aconfig protos paths.
* @hide
*/
- public static List<String> parsedFlagsProtoPaths() {
+ private static List<String> parsedFlagsProtoPaths() {
ArrayList<String> paths = new ArrayList(Arrays.asList(PATHS));
File apexDirectory = new File(APEX_DIR);
diff --git a/tools/aconfig/fake_device_config/Android.bp b/tools/aconfig/fake_device_config/Android.bp
index d6a1f22..7704742 100644
--- a/tools/aconfig/fake_device_config/Android.bp
+++ b/tools/aconfig/fake_device_config/Android.bp
@@ -22,6 +22,7 @@
sdk_version: "none",
system_modules: "core-all-system-modules",
host_supported: true,
+ is_stubs_module: true,
}
java_library {
@@ -31,4 +32,5 @@
],
sdk_version: "core_current",
host_supported: true,
+ is_stubs_module: true,
}
diff --git a/tools/releasetools/Android.bp b/tools/releasetools/Android.bp
index 9b134f2..56af60f 100644
--- a/tools/releasetools/Android.bp
+++ b/tools/releasetools/Android.bp
@@ -96,6 +96,7 @@
],
libs: [
"apex_manifest",
+ "releasetools_apex_utils",
"releasetools_common",
],
required: [
diff --git a/tools/releasetools/apex_utils.py b/tools/releasetools/apex_utils.py
index 3abef3b..54df955 100644
--- a/tools/releasetools/apex_utils.py
+++ b/tools/releasetools/apex_utils.py
@@ -36,6 +36,8 @@
APEX_PUBKEY = 'apex_pubkey'
+# Partitions supporting APEXes
+PARTITIONS = ['system', 'system_ext', 'product', 'vendor', 'odm']
class ApexInfoError(Exception):
"""An Exception raised during Apex Information command."""
@@ -550,7 +552,7 @@
if not isinstance(input_file, str):
raise RuntimeError("must pass filepath to target-files zip or directory")
apex_infos = []
- for partition in ['system', 'system_ext', 'product', 'vendor']:
+ for partition in PARTITIONS:
apex_infos.extend(GetApexInfoForPartition(input_file, partition))
return apex_infos
diff --git a/tools/releasetools/check_target_files_vintf.py b/tools/releasetools/check_target_files_vintf.py
index b8dcd84..dc123ef 100755
--- a/tools/releasetools/check_target_files_vintf.py
+++ b/tools/releasetools/check_target_files_vintf.py
@@ -30,6 +30,7 @@
import sys
import zipfile
+import apex_utils
import common
from apex_manifest import ParseApexManifest
@@ -229,7 +230,7 @@
apex_host = os.path.join(OPTIONS.search_path, 'bin', 'apexd_host')
cmd = [apex_host, '--tool_path', OPTIONS.search_path]
cmd += ['--apex_path', dirmap['/apex']]
- for p in ['system', 'system_ext', 'product', 'vendor']:
+ for p in apex_utils.PARTITIONS:
if '/' + p in dirmap:
cmd += ['--' + p + '_path', dirmap['/' + p]]
common.RunAndCheckOutput(cmd)
diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py
index f6f6944..5d942b5 100644
--- a/tools/releasetools/common.py
+++ b/tools/releasetools/common.py
@@ -907,9 +907,10 @@
d["root_fs_config"] = os.path.join(
input_file, "META", "root_filesystem_config.txt")
+ partitions = ["system", "vendor", "system_ext", "product", "odm",
+ "vendor_dlkm", "odm_dlkm", "system_dlkm"]
# Redirect {partition}_base_fs_file for each of the named partitions.
- for part_name in ["system", "vendor", "system_ext", "product", "odm",
- "vendor_dlkm", "odm_dlkm", "system_dlkm"]:
+ for part_name in partitions:
key_name = part_name + "_base_fs_file"
if key_name not in d:
continue
@@ -922,6 +923,25 @@
"Failed to find %s base fs file: %s", part_name, base_fs_file)
del d[key_name]
+ # Redirecting helper for optional properties like erofs_compress_hints
+ def redirect_file(prop, filename):
+ if prop not in d:
+ return
+ config_file = os.path.join(input_file, "META/" + filename)
+ if os.path.exists(config_file):
+ d[prop] = config_file
+ else:
+ logger.warning(
+ "Failed to find %s fro %s", filename, prop)
+ del d[prop]
+
+ # Redirect erofs_[default_]compress_hints files
+ redirect_file("erofs_default_compress_hints",
+ "erofs_default_compress_hints.txt")
+ for part in partitions:
+ redirect_file(part + "_erofs_compress_hints",
+ part + "_erofs_compress_hints.txt")
+
def makeint(key):
if key in d:
d[key] = int(d[key], 0)