Fix the input parameter for "set_retry_bootloader_message"

We're not updating argc & argv during get_args(), so some boot
arguments missed when we set the boot message for retry.

Bug: 38383406
Test: boot command sets correctly during retry attempt.
Change-Id: Ie8583a22fad5e0084245e3431d4018518d508dfd
diff --git a/recovery.cpp b/recovery.cpp
index 944c240..dfae7f0 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -1304,20 +1304,20 @@
     }
 }
 
-static void set_retry_bootloader_message(int retry_count, int argc, char** argv) {
-    std::vector<std::string> options;
-    for (int i = 1; i < argc; ++i) {
-        if (strstr(argv[i], "retry_count") == nullptr) {
-            options.push_back(argv[i]);
-        }
+static void set_retry_bootloader_message(int retry_count, const std::vector<std::string>& args) {
+  std::vector<std::string> options;
+  for (const auto& arg : args) {
+    if (!android::base::StartsWith(arg, "--retry_count")) {
+      options.push_back(arg);
     }
+  }
 
-    // Increment the retry counter by 1.
-    options.push_back(android::base::StringPrintf("--retry_count=%d", retry_count+1));
-    std::string err;
-    if (!update_bootloader_message(options, &err)) {
-        LOG(ERROR) << err;
-    }
+  // Increment the retry counter by 1.
+  options.push_back(android::base::StringPrintf("--retry_count=%d", retry_count + 1));
+  std::string err;
+  if (!update_bootloader_message(options, &err)) {
+    LOG(ERROR) << err;
+  }
 }
 
 static bool bootreason_in_blacklist() {
@@ -1534,7 +1534,7 @@
                 // times before we abandon this OTA update.
                 if (status == INSTALL_RETRY && retry_count < EIO_RETRY_COUNT) {
                     copy_logs();
-                    set_retry_bootloader_message(retry_count, argc, argv);
+                    set_retry_bootloader_message(retry_count, args);
                     // Print retry count on screen.
                     ui->Print("Retry attempt %d\n", retry_count);