Enable Dynamic partition [2/2]

* Set relevant flags to enable Retrofit Dynamic partitions
* Build custom dynamic partition binary

Issue: FP3-A11#146
Change-Id: Ifccd7627ffd5122d45f080ecf4b3bc421722ae27
diff --git a/device.mk b/device.mk
index 88e9628..752b66f 100644
--- a/device.mk
+++ b/device.mk
@@ -99,6 +99,31 @@
 PRODUCT_PACKAGES += \
 	update_engine_sideload
 
+# Dynamic Partition
+# Enable retrofit dynamic partitions for FP3
+PRODUCT_USE_DYNAMIC_PARTITIONS := true
+PRODUCT_RETROFIT_DYNAMIC_PARTITIONS := true
+
+# Additional OTA partitions
+ifeq ($(PRODUCT_USE_DYNAMIC_PARTITIONS), true)
+AB_OTA_PARTITIONS += \
+	odm \
+	product \
+	system_ext
+
+# Check OTA update status
+PRODUCT_PACKAGES += check_dynamic_partitions
+
+# Ramdisk fstab file
+PRODUCT_PACKAGES += fstab_ramdisk.qcom
+
+AB_OTA_POSTINSTALL_CONFIG += \
+	RUN_POSTINSTALL_product=true \
+	POSTINSTALL_PATH_product=bin/check_dynamic_partitions \
+	FILESYSTEM_TYPE_product=ext4 \
+	POSTINSTALL_OPTIONAL_product=false
+
+endif
 
 # APN
 PRODUCT_COPY_FILES += \