Merge "Return the correct action for PromptAndWait" am: 99277fa6af am: c55e7fd95d am: b5d418af52

Original change: https://android-review.googlesource.com/c/platform/bootable/recovery/+/1398888

Change-Id: I70131aeb3dd61b165c6671bf26f8e69e5381433d
diff --git a/recovery.cpp b/recovery.cpp
index 84deeb4..36924fb 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -421,15 +421,15 @@
       case Device::REBOOT:
       case Device::SHUTDOWN:
         if (!ui->IsTextVisible()) {
-          return Device::REBOOT;
+          return chosen_action;
         }
         // okay to reboot; no need to ask.
         if (!update_in_progress) {
-          return Device::REBOOT;
+          return chosen_action;
         }
         // An update might have been failed. Ask if user really wants to reboot.
         if (AskToReboot(device, chosen_action)) {
-          return Device::REBOOT;
+          return chosen_action;
         }
         break;