Merge "releasetools: Add sanity test for sign_apex."
diff --git a/core/Makefile b/core/Makefile
index ec9029b..f712a84 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -1088,6 +1088,7 @@
# Remove when b/63676296 is resolved.
$(error Prebuilt bootimage is only supported for AB targets)
endif
+INSTALLED_BOOTIMAGE_TARGET := $(PRODUCT_OUT)/boot.img
$(eval $(call copy-one-file,$(BOARD_PREBUILT_BOOTIMAGE),$(INSTALLED_BOOTIMAGE_TARGET)))
else # BOARD_PREBUILT_BOOTIMAGE not defined
INSTALLED_BOOTIMAGE_TARGET :=
diff --git a/core/dex_preopt_config.mk b/core/dex_preopt_config.mk
index 5693147..570dbd8 100644
--- a/core/dex_preopt_config.mk
+++ b/core/dex_preopt_config.mk
@@ -138,9 +138,7 @@
$(call end_json_map)
$(call add_json_str, DirtyImageObjects, $(DIRTY_IMAGE_OBJECTS))
- $(call add_json_str, PreloadedClasses, $(PRELOADED_CLASSES))
$(call add_json_list, BootImageProfiles, $(PRODUCT_DEX_PREOPT_BOOT_IMAGE_PROFILE_LOCATION))
- $(call add_json_bool, UseProfileForBootImage, $(call invert_bool,$(filter false,$(PRODUCT_USE_PROFILE_FOR_BOOT_IMAGE))))
$(call add_json_str, BootFlags, $(PRODUCT_DEX_PREOPT_BOOT_FLAGS))
$(call add_json_str, Dex2oatImageXmx, $(DEX2OAT_IMAGE_XMX))
$(call add_json_str, Dex2oatImageXms, $(DEX2OAT_IMAGE_XMS))
diff --git a/target/product/mainline_system.mk b/target/product/mainline_system.mk
index 87393d4..f836bd3 100644
--- a/target/product/mainline_system.mk
+++ b/target/product/mainline_system.mk
@@ -99,8 +99,6 @@
# Enable stats logging in LMKD
TARGET_LMKD_STATS_LOG := true
-PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
- ro.lmk.log_stats=true
# Enable dynamic partition size
PRODUCT_USE_DYNAMIC_PARTITION_SIZE := true
diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py
index 107b6f5..4bebef5 100644
--- a/tools/releasetools/common.py
+++ b/tools/releasetools/common.py
@@ -459,6 +459,13 @@
return LoadDictionaryFromLines(data.split("\n"))
+def LoadDictionaryFromFile(file_path):
+ with open(file_path) as f:
+ lines = list(f.read().splitlines())
+
+ return LoadDictionaryFromLines(lines)
+
+
def LoadDictionaryFromLines(lines):
d = {}
for line in lines:
diff --git a/tools/releasetools/merge_target_files.py b/tools/releasetools/merge_target_files.py
index f0ae217..e2b0e3d 100755
--- a/tools/releasetools/merge_target_files.py
+++ b/tools/releasetools/merge_target_files.py
@@ -334,9 +334,9 @@
in_vendor = any(item.startswith(partition) for item in vendor_item_list)
if in_framework and in_vendor:
logger.error(
- 'Cannot extract items from {0} for both the framework and vendor builds. '
- 'Please ensure only one merge config item list includes {0}.'.format(
- partition))
+ 'Cannot extract items from {0} for both the framework and vendor'
+ ' builds. Please ensure only one merge config item list'
+ ' includes {0}.'.format(partition))
has_error = True
if ('dynamic_partition_list' in framework_misc_info_keys) or (
@@ -500,18 +500,14 @@
instance.
"""
- def read_helper(d):
- misc_info_txt = os.path.join(d, 'META', 'misc_info.txt')
- with open(misc_info_txt) as f:
- return list(f.read().splitlines())
-
- framework_dict = common.LoadDictionaryFromLines(
- read_helper(framework_target_files_temp_dir))
+ misc_info_path = ['META', 'misc_info.txt']
+ framework_dict = common.LoadDictionaryFromFile(
+ os.path.join(framework_target_files_temp_dir, *misc_info_path))
# We take most of the misc info from the vendor target files.
- merged_dict = common.LoadDictionaryFromLines(
- read_helper(vendor_target_files_temp_dir))
+ merged_dict = common.LoadDictionaryFromFile(
+ os.path.join(vendor_target_files_temp_dir, *misc_info_path))
# Replace certain values in merged_dict with values from
# framework_dict.
@@ -578,16 +574,12 @@
'dynamic_partitions_info.txt')):
return
- def read_helper(d):
- dynamic_partitions_info_txt = os.path.join(d, 'META',
- 'dynamic_partitions_info.txt')
- with open(dynamic_partitions_info_txt) as f:
- return list(f.read().splitlines())
+ dynamic_partitions_info_path = ['META', 'dynamic_partitions_info.txt']
- framework_dynamic_partitions_dict = common.LoadDictionaryFromLines(
- read_helper(framework_target_files_dir))
- vendor_dynamic_partitions_dict = common.LoadDictionaryFromLines(
- read_helper(vendor_target_files_dir))
+ framework_dynamic_partitions_dict = common.LoadDictionaryFromFile(
+ os.path.join(framework_target_files_dir, *dynamic_partitions_info_path))
+ vendor_dynamic_partitions_dict = common.LoadDictionaryFromFile(
+ os.path.join(vendor_target_files_dir, *dynamic_partitions_info_path))
merged_dynamic_partitions_dict = merge_dynamic_partition_info_dicts(
framework_dict=framework_dynamic_partitions_dict,
@@ -854,12 +846,8 @@
misc_info_txt = os.path.join(output_target_files_temp_dir, 'META',
'misc_info.txt')
- def read_helper():
- with open(misc_info_txt) as f:
- return list(f.read().splitlines())
-
- use_dynamic_partitions = common.LoadDictionaryFromLines(
- read_helper()).get('use_dynamic_partitions')
+ use_dynamic_partitions = common.LoadDictionaryFromFile(misc_info_txt).get(
+ 'use_dynamic_partitions')
if use_dynamic_partitions != 'true' and output_super_empty:
raise ValueError(
@@ -1000,7 +988,8 @@
OPTIONS.framework_item_list = a
elif o == '--system-misc-info-keys':
logger.warning(
- '--system-misc-info-keys has been renamed to --framework-misc-info-keys'
+ '--system-misc-info-keys has been renamed to '
+ '--framework-misc-info-keys'
)
OPTIONS.framework_misc_info_keys = a
elif o == '--framework-misc-info-keys':