recovery: add support for changing slots

* reference: https://github.com/omnirom/android_bootable_recovery/commit/1b190166eb1295c6339f6100e4fbb92c81b81ea6

Change-Id: I848e003ca569dfaa572ce7641775f0ea9f2b5513
Signed-off-by: jhonboy121 <alfredmathew05@gmail.com>
Signed-off-by: Sipun Ku Mahanta <sipunkumar85@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

recovery: rewrite slot switch logic using bootcontrol APIs

Change-Id: I1eb136c81cc9246b0c9f5e52bcf6e7ba40fbc12d
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
diff --git a/recovery_main.cpp b/recovery_main.cpp
index 7597418..e006acc 100644
--- a/recovery_main.cpp
+++ b/recovery_main.cpp
@@ -477,6 +477,8 @@
     // because ROMs are flashed to the inactive slot. Removing the menu option
     // prevents users from accidentally trashing a functioning ROM.
     device->RemoveMenuItemForAction(Device::WIPE_SYSTEM);
+  } else {
+    device->RemoveMenuItemForAction(Device::SWAP_SLOT);
   }
 
   if (!android::base::GetBoolProperty("ro.boot.dynamic_partitions", false) &&