Reland: build: Enable super image build rules depending on single super block device

* The current logic does not suit for multiple block devices case,
  it generates split images hence output dir shall be specified
* Multiple block devices is possible with non-RDAP too, and it could
  work for RDAP with single block device, so it's incorrect to depend
  on RDAP flag

Reason: Several 4.14 and 4.19 shipping devices use this.

Original-Change-Id: I8563b96b35351ef0a3b40ae172c2e904ee57f85e
Change-Id: I0027d483ce5b27a5a3c86db4aac7e0a4e3fb9831
diff --git a/core/Makefile b/core/Makefile
index 7826342..c994dd0 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -7598,7 +7598,7 @@
 # BOARD_SUPER_PARTITION_SIZE must be defined to build super image.
 ifneq ($(BOARD_SUPER_PARTITION_SIZE),)
 
-ifneq (true,$(PRODUCT_RETROFIT_DYNAMIC_PARTITIONS))
+ifeq ($(words $(BOARD_SUPER_PARTITION_BLOCK_DEVICES)),1)
 
 # For real devices and for dist builds, build super image from target files to an intermediate directory.
 INTERNAL_SUPERIMAGE_DIST_TARGET := $(call intermediates-dir-for,PACKAGING,super.img)/super.img
@@ -7616,7 +7616,7 @@
 .PHONY: superimage_dist
 superimage_dist: $(INTERNAL_SUPERIMAGE_DIST_TARGET)
 
-endif # PRODUCT_RETROFIT_DYNAMIC_PARTITIONS != "true"
+endif # $(words $(BOARD_SUPER_PARTITION_BLOCK_DEVICES)) == 1
 endif # BOARD_SUPER_PARTITION_SIZE != ""
 endif # PRODUCT_BUILD_SUPER_PARTITION == "true"
 
@@ -7625,7 +7625,7 @@
 
 ifeq (true,$(PRODUCT_BUILD_SUPER_PARTITION))
 ifneq ($(BOARD_SUPER_PARTITION_SIZE),)
-ifneq (true,$(PRODUCT_RETROFIT_DYNAMIC_PARTITIONS))
+ifeq ($(words $(BOARD_SUPER_PARTITION_BLOCK_DEVICES)),1)
 
 # Build super.img by using $(INSTALLED_*IMAGE_TARGET) to $(1)
 # $(1): built image path
@@ -7682,7 +7682,7 @@
 	$(call build-superimage-target,$(INSTALLED_SUPERIMAGE_TARGET),\
 	  $(call intermediates-dir-for,PACKAGING,superimage-nodeps)/misc_info.txt)
 
-endif # PRODUCT_RETROFIT_DYNAMIC_PARTITIONS != "true"
+endif # $(words $(BOARD_SUPER_PARTITION_BLOCK_DEVICES)) == 1
 endif # BOARD_SUPER_PARTITION_SIZE != ""
 endif # PRODUCT_BUILD_SUPER_PARTITION == "true"