recovery: Print the active slot

Addresses https://gitlab.com/LineageOS/issues/android/-/issues/1893

Change-Id: I9fd731c3427c3a52641aa2e9c89eb9a20bafdd57
diff --git a/recovery.cpp b/recovery.cpp
index 16be7e8..9e31ab3 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -739,6 +739,11 @@
     "Version " + android::base::GetProperty("ro.lineage.build.version", "(unknown)") +
         " (" + ver_date + ")",
   };
+  if (android::base::GetBoolProperty("ro.build.ab_update", false)) {
+    std::string slot = android::base::GetProperty("ro.boot.slot_suffix", "");
+    if (android::base::StartsWith(slot, "_")) slot.erase(0, 1);
+    title_lines.push_back("Active slot: " + slot);
+  }
   ui->SetTitle(title_lines);
 
   ui->ResetKeyInterruptStatus();