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 1ee49d4..a91629e 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -735,6 +735,12 @@
   std::vector<std::string> title_lines =
       android::base::Split(android::base::GetProperty("ro.build.fingerprint", ""), ":");
   title_lines.insert(std::begin(title_lines), "Android Recovery");
+
+  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();