Merge changes from topic "revert-3554551-revert-3542808-FGVHVOTNBS-LHCRLYWRIW" into main
* changes:
Revert^2 "Replace test suites symbols.zip name patterns"
Revert^2 "Remove redundant entries from symbols.zip"
Revert^2 "Create symbols.zip per test suite"
Revert^2 "Generate symbols mapping files for jni libs"
Revert "Revert "Modify the params of copy-unstripped-elf-file-wi..."
diff --git a/core/soong_config.mk b/core/soong_config.mk
index f5c5238..b774648 100644
--- a/core/soong_config.mk
+++ b/core/soong_config.mk
@@ -570,6 +570,10 @@
$(call add_json_str, ReleaseToolsExtensionDir, $(firstword $(TARGET_RELEASETOOLS_EXTENSIONS) $($(TARGET_DEVICE_DIR)/../common)))
+ $(call add_json_list, BoardPartialOtaUpdatePartitionsList, $(BOARD_PARTIAL_OTA_UPDATE_PARTITIONS_LIST))
+ $(call add_json_str, BoardFlashBlockSize, $(BOARD_FLASH_BLOCK_SIZE))
+ $(call add_json_bool, BootloaderInUpdatePackage, $(BOARD_BOOTLOADER_IN_UPDATE_PACKAGE))
+
# Fastboot
$(call add_json_str, BoardFastbootInfoFile, $(TARGET_BOARD_FASTBOOT_INFO_FILE))
diff --git a/tools/aconfig/convert_finalized_flags/src/lib.rs b/tools/aconfig/convert_finalized_flags/src/lib.rs
index d79c509..335a31b 100644
--- a/tools/aconfig/convert_finalized_flags/src/lib.rs
+++ b/tools/aconfig/convert_finalized_flags/src/lib.rs
@@ -26,6 +26,8 @@
use std::fs;
use std::io::{self, BufRead};
+const SDK_INT_MULTIPLIER: u32 = 100_000;
+
/// Just the fully qualified flag name (package_name.flag_name).
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, Hash)]
pub struct FinalizedFlag {
@@ -81,6 +83,24 @@
}
}
+#[allow(dead_code)] // TODO: b/378936061: Use with SDK_INT_FULL check.
+fn parse_full_version(version: String) -> Result<u32> {
+ let (major, minor) = if let Some(decimal_index) = version.find('.') {
+ (version[..decimal_index].parse::<u32>()?, version[decimal_index + 1..].parse::<u32>()?)
+ } else {
+ (version.parse::<u32>()?, 0)
+ };
+
+ if major >= 21474 {
+ return Err(anyhow!("Major version too large, must be less than 21474."));
+ }
+ if minor >= SDK_INT_MULTIPLIER {
+ return Err(anyhow!("Minor version too large, must be less than {}.", SDK_INT_MULTIPLIER));
+ }
+
+ Ok(major * SDK_INT_MULTIPLIER + minor)
+}
+
const EXTENDED_FLAGS_LIST_35: &str = "extended_flags_list_35.txt";
/// Converts a string to an int. Will parse to int even if the string is "X.0".
@@ -461,4 +481,83 @@
"Provided incorrect file, must be extended_flags_list_35.txt"
);
}
+
+ #[test]
+ fn test_parse_full_version_correct_input_major_dot_minor() {
+ let version = parse_full_version("12.34".to_string());
+
+ assert!(version.is_ok());
+ assert_eq!(version.unwrap(), 1_200_034);
+ }
+
+ #[test]
+ fn test_parse_full_version_correct_input_omit_dot_minor() {
+ let version = parse_full_version("1234".to_string());
+
+ assert!(version.is_ok());
+ assert_eq!(version.unwrap(), 123_400_000);
+ }
+
+ #[test]
+ fn test_parse_full_version_incorrect_input_empty_string() {
+ let version = parse_full_version("".to_string());
+
+ assert!(version.is_err());
+ }
+
+ #[test]
+ fn test_parse_full_version_incorrect_input_no_numbers_in_string() {
+ let version = parse_full_version("hello".to_string());
+
+ assert!(version.is_err());
+ }
+
+ #[test]
+ fn test_parse_full_version_incorrect_input_unexpected_patch_version() {
+ let version = parse_full_version("1.2.3".to_string());
+
+ assert!(version.is_err());
+ }
+
+ #[test]
+ fn test_parse_full_version_incorrect_input_leading_dot_missing_major_version() {
+ let version = parse_full_version(".1234".to_string());
+
+ assert!(version.is_err());
+ }
+
+ #[test]
+ fn test_parse_full_version_incorrect_input_trailing_dot_missing_minor_version() {
+ let version = parse_full_version("1234.".to_string());
+
+ assert!(version.is_err());
+ }
+
+ #[test]
+ fn test_parse_full_version_incorrect_input_negative_major_version() {
+ let version = parse_full_version("-12.34".to_string());
+
+ assert!(version.is_err());
+ }
+
+ #[test]
+ fn test_parse_full_version_incorrect_input_negative_minor_version() {
+ let version = parse_full_version("12.-34".to_string());
+
+ assert!(version.is_err());
+ }
+
+ #[test]
+ fn test_parse_full_version_incorrect_input_major_version_too_large() {
+ let version = parse_full_version("40000.1".to_string());
+
+ assert!(version.is_err());
+ }
+
+ #[test]
+ fn test_parse_full_version_incorrect_input_minor_version_too_large() {
+ let version = parse_full_version("3.99999999".to_string());
+
+ assert!(version.is_err());
+ }
}