Add a header value for configure max downlaod retry count

Allow partners to set a custom retry count.

Test: th
Bug: 242902308
Change-Id: Idc04b7149d1f91e0108c947a8e3eed0d4f0e8b5e
diff --git a/aosp/update_attempter_android.cc b/aosp/update_attempter_android.cc
index aab6d2d..9b90030 100644
--- a/aosp/update_attempter_android.cc
+++ b/aosp/update_attempter_android.cc
@@ -331,6 +331,10 @@
     LOG(FATAL) << "Unsupported sideload URI: " << payload_url;
 #else
     LibcurlHttpFetcher* libcurl_fetcher = new LibcurlHttpFetcher(hardware_);
+    if (!headers[kPayloadDownloadRetry].empty()) {
+      libcurl_fetcher->set_max_retry_count(
+          atoi(headers[kPayloadDownloadRetry].c_str()));
+    }
     libcurl_fetcher->set_server_to_check(ServerToCheck::kDownload);
     fetcher = libcurl_fetcher;
 #endif  // _UE_SIDELOAD