aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTianjie Xu2017-05-16 20:07:31 -0500
committerTianjie Xu2017-05-17 13:09:35 -0500
commit72449c9f995649b1427b2116985ed9826a141d46 (patch)
tree2e76bdbeb6a4de0434c9060d7dc91ab3ab702102 /recovery.cpp
parent494d97fe6b456e516cf210f01a4436d488658306 (diff)
downloadplatform-bootable-recovery-72449c9f995649b1427b2116985ed9826a141d46.tar.gz
platform-bootable-recovery-72449c9f995649b1427b2116985ed9826a141d46.tar.xz
platform-bootable-recovery-72449c9f995649b1427b2116985ed9826a141d46.zip
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
Diffstat (limited to 'recovery.cpp')
-rw-r--r--recovery.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/recovery.cpp b/recovery.cpp
index 944c2408..dfae7f03 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -1304,20 +1304,20 @@ static bool is_battery_ok() {
1304 } 1304 }
1305} 1305}
1306 1306
1307static void set_retry_bootloader_message(int retry_count, int argc, char** argv) { 1307static void set_retry_bootloader_message(int retry_count, const std::vector<std::string>& args) {
1308 std::vector<std::string> options; 1308 std::vector<std::string> options;
1309 for (int i = 1; i < argc; ++i) { 1309 for (const auto& arg : args) {
1310 if (strstr(argv[i], "retry_count") == nullptr) { 1310 if (!android::base::StartsWith(arg, "--retry_count")) {
1311 options.push_back(argv[i]); 1311 options.push_back(arg);
1312 }
1313 } 1312 }
1313 }
1314 1314
1315 // Increment the retry counter by 1. 1315 // Increment the retry counter by 1.
1316 options.push_back(android::base::StringPrintf("--retry_count=%d", retry_count+1)); 1316 options.push_back(android::base::StringPrintf("--retry_count=%d", retry_count + 1));
1317 std::string err; 1317 std::string err;
1318 if (!update_bootloader_message(options, &err)) { 1318 if (!update_bootloader_message(options, &err)) {
1319 LOG(ERROR) << err; 1319 LOG(ERROR) << err;
1320 } 1320 }
1321} 1321}
1322 1322
1323static bool bootreason_in_blacklist() { 1323static bool bootreason_in_blacklist() {
@@ -1534,7 +1534,7 @@ int main(int argc, char **argv) {
1534 // times before we abandon this OTA update. 1534 // times before we abandon this OTA update.
1535 if (status == INSTALL_RETRY && retry_count < EIO_RETRY_COUNT) { 1535 if (status == INSTALL_RETRY && retry_count < EIO_RETRY_COUNT) {
1536 copy_logs(); 1536 copy_logs();
1537 set_retry_bootloader_message(retry_count, argc, argv); 1537 set_retry_bootloader_message(retry_count, args);
1538 // Print retry count on screen. 1538 // Print retry count on screen.
1539 ui->Print("Retry attempt %d\n", retry_count); 1539 ui->Print("Retry attempt %d\n", retry_count);
1540 1540