From 160e8d39555a534d5f58346152e3e7a6fe89dc3f Mon Sep 17 00:00:00 2001 From: Ian Macdonald Date: Tue, 29 Sep 2020 20:47:31 +0200 Subject: [PATCH] Improve 'super' partition description in back-up menu. For the back-up menu, we can detail what the super partition includes by aggregating one of BOARD_GOOGLE_DYNAMIC_PARTITIONS_PARTITION_LIST or BOARD_QTI_DYNAMIC_PARTITIONS_PARTITION_LIST. We comma-separate the list and capitalise the first letter of each dynamic partition. Change-Id: I663eaf4f28b4591293aae21c2dd11f615f625746 --- Android.mk | 9 +++++++++ partitionmanager.cpp | 8 ++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Android.mk b/Android.mk index 56f49263..5b2bdb15 100755 --- a/Android.mk +++ b/Android.mk @@ -153,6 +153,15 @@ ifeq ($(PRODUCT_USE_DYNAMIC_PARTITIONS),true) LOCAL_CFLAGS += -DPRODUCT_USE_DYNAMIC_PARTITIONS=1 endif +ifneq ($(BOARD_GOOGLE_DYNAMIC_PARTITIONS_PARTITION_LIST),) + BOARD_DYNAMIC_PARTITIONS_PARTITION_LIST := $(BOARD_GOOGLE_DYNAMIC_PARTITIONS_PARTITION_LIST) +else ifneq ($(BOARD_QTI_DYNAMIC_PARTITIONS_PARTITION_LIST),) + BOARD_DYNAMIC_PARTITIONS_PARTITION_LIST := $(BOARD_QTI_DYNAMIC_PARTITIONS_PARTITION_LIST) +endif +ifneq ($(BOARD_DYNAMIC_PARTITIONS_PARTITION_LIST),) + LOCAL_CFLAGS += "-DBOARD_DYNAMIC_PARTITIONS_PARTITION_LIST=\"$(shell echo $(BOARD_DYNAMIC_PARTITIONS_PARTITION_LIST) | sed -r 's/\b(.)/\u\1/g' | sed -e 's/ \+/, /g')\"" +endif + ifeq ($(TW_NO_BIND_SYSTEM),true) LOCAL_CFLAGS += -DTW_NO_BIND_SYSTEM endif diff --git a/partitionmanager.cpp b/partitionmanager.cpp index 1533bf72..79de55fc 100755 --- a/partitionmanager.cpp +++ b/partitionmanager.cpp @@ -144,7 +144,7 @@ int TWPartitionManager::Process_Fstab(string Fstab_Filename, bool Display_Error) fstabFile = fopen("/etc/twrp.flags", "rt"); if (fstabFile != NULL) { - LOGINFO("reading /etc/twrp.flags\n"); + LOGINFO("Reading /etc/twrp.flags\n"); while (fgets(fstab_line, sizeof(fstab_line), fstabFile) != NULL) { if (fstab_line[0] != '/') continue; @@ -3229,7 +3229,11 @@ void TWPartitionManager::Setup_Super_Partition() { superPartition->Mount_Point = "/super"; superPartition->Actual_Block_Device = superPart; superPartition->Alternate_Block_Device = superPart; - superPartition->Backup_Display_Name = "super"; +#ifdef BOARD_DYNAMIC_PARTITIONS_PARTITION_LIST + superPartition->Backup_Display_Name = "Super (" BOARD_DYNAMIC_PARTITIONS_PARTITION_LIST ")"; +#else + superPartition->Backup_Display_Name = "Super"; +#endif superPartition->Can_Flash_Img = true; superPartition->Current_File_System = "emmc"; superPartition->Can_Be_Backed_Up = true;