Split PRODUCT_USE_LOGICAL_PARTITIONS into sub-flags.

Split the flag into PRODUCT_USE_DYNAMIC_PARTITION_SIZE
and PRODUCT_BUILD_SUPER_PARTITION. More sub-flags can be
added with the same way.

Also change some checks with USE_LOGICAL_PARTITIONS with
the appropriate sub-flags.

This allows easier device bring-up to fulfill the requirements
separately.

This also enables dynamic partition size without logical patition.
Originally, to enable BOARD_*_PARTITION_RESERVED_SIZE must also
enable PRODUCT_USE_LOGICAL_PARTITIONS. The patch fix the rule to
let dynamic partition size is able to be used independently.

Fixes: 111966003

Test: make superimage with PRODUCT_USE_LOGICAL_PARTITIONS
Change-Id: I45b29c87bf94356d8416bbd58a14c8982039c222
diff --git a/core/Makefile b/core/Makefile
index bd493a6..0d04f14 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -1293,7 +1293,7 @@
 $(if $(filter true,$(BOARD_BUILD_SYSTEM_ROOT_IMAGE)),\
     $(hide) echo "system_root_image=true" >> $(1)
     $(hide) echo "root_dir=$(TARGET_ROOT_OUT)" >> $(1))
-$(if $(USE_LOGICAL_PARTITIONS),$(hide) echo "use_logical_partitions=true" >> $(1))
+$(if $(PRODUCT_USE_DYNAMIC_PARTITION_SIZE),$(hide) echo "use_dynamic_partition_size=true" >> $(1))
 $(if $(3),$(hide) $(foreach kv,$(3),echo "$(kv)" >> $(1);))
 endef
 
@@ -2584,7 +2584,7 @@
 $(foreach p,$(1),$(call read-image-prop-dictionary,$($(p)image_intermediates)/generated_$(p)_image_info.txt,$(p)_size))
 endef
 
-ifeq (true,$(USE_LOGICAL_PARTITIONS))
+ifeq (true,$(PRODUCT_BUILD_SUPER_PARTITION))
 
 # BOARD_SUPER_PARTITION_SIZE must be defined to build super image.
 ifdef BOARD_SUPER_PARTITION_SIZE
@@ -2617,7 +2617,7 @@
 $(call dist-for-goals,dist_files,$(INSTALLED_SUPERIMAGE_TARGET))
 
 endif # BOARD_SUPER_PARTITION_SIZE
-endif # USE_LOGICAL_PARTITIONS
+endif # PRODUCT_BUILD_SUPER_PARTITION
 
 # -----------------------------------------------------------------
 # Check image sizes <= size of super partition
@@ -2625,7 +2625,7 @@
 ifeq (,$(TARGET_BUILD_APPS))
 # Do not check for apps-only build
 
-ifeq (true,$(USE_LOGICAL_PARTITIONS))
+ifeq (true,$(PRODUCT_BUILD_SUPER_PARTITION))
 ifdef BOARD_SUPER_PARTITION_SIZE
 ifdef BOARD_SUPER_PARTITION_PARTITION_LIST
 
@@ -2650,7 +2650,7 @@
 
 endif # BOARD_SUPER_PARTITION_PARTITION_LIST
 endif # BOARD_SUPER_PARTITION_SIZE
-endif # USE_LOGICAL_PARTITIONS
+endif # PRODUCT_BUILD_SUPER_PARTITION
 
 endif # TARGET_BUILD_APPS