Merge "Allows skipping building the super images for partial builds." am: 87ebb3013f
am: d3576727ea

Change-Id: I872f713f9f8ff30b3dd72643b07443894b5af451
diff --git a/core/config.mk b/core/config.mk
index bf15b61..748d4c6 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -926,10 +926,6 @@
         $(BOARD_$(group)_PARTITION_LIST))
 .KATI_READONLY := BOARD_SUPER_PARTITION_PARTITION_LIST
 
-endif # PRODUCT_USE_DYNAMIC_PARTITIONS
-
-ifeq ($(PRODUCT_BUILD_SUPER_PARTITION),true)
-
 ifneq ($(BOARD_SUPER_PARTITION_SIZE),)
 ifeq ($(PRODUCT_RETROFIT_DYNAMIC_PARTITIONS),true)
 
@@ -989,8 +985,11 @@
 
 endif # PRODUCT_RETROFIT_DYNAMIC_PARTITIONS
 endif # BOARD_SUPER_PARTITION_SIZE
+BOARD_SUPER_PARTITION_BLOCK_DEVICES ?=
 .KATI_READONLY := BOARD_SUPER_PARTITION_BLOCK_DEVICES
+BOARD_SUPER_PARTITION_METADATA_DEVICE ?=
 .KATI_READONLY := BOARD_SUPER_PARTITION_METADATA_DEVICE
+BOARD_BUILD_RETROFIT_DYNAMIC_PARTITIONS_OTA_PACKAGE ?=
 .KATI_READONLY := BOARD_BUILD_RETROFIT_DYNAMIC_PARTITIONS_OTA_PACKAGE
 
 $(foreach device,$(call to-upper,$(BOARD_SUPER_PARTITION_BLOCK_DEVICES)), \
@@ -999,7 +998,7 @@
         $(error BOARD_SUPER_PARTITION_$(device)_DEVICE_SIZE must not be empty)) \
     $(eval .KATI_READONLY := BOARD_SUPER_PARTITION_$(device)_DEVICE_SIZE))
 
-endif # PRODUCT_BUILD_SUPER_PARTITION
+endif # PRODUCT_USE_DYNAMIC_PARTITIONS
 
 # ###############################################################
 # Set up final options.
diff --git a/tools/releasetools/merge_target_files.py b/tools/releasetools/merge_target_files.py
index f37c0ee..f0ae217 100755
--- a/tools/releasetools/merge_target_files.py
+++ b/tools/releasetools/merge_target_files.py
@@ -530,6 +530,10 @@
         list_prefix='super_',
         list_suffix='_partition_list')
     merged_dict.update(merged_dynamic_partitions_dict)
+    # Ensure that add_img_to_target_files rebuilds super_empty.img. This flag
+    # may have been set to false in the partial builds to prevent duplicate
+    # building of super.img and super_empty.img.
+    merged_dict['build_super_partition'] = 'true'
 
   # Replace <image>_selinux_fc values with framework or vendor file_contexts.bin
   # depending on which dictionary the key came from.