11/*
2- * Copyright (C) 2019-2021 HERE Europe B.V.
2+ * Copyright (C) 2019-2025 HERE Europe B.V.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -148,22 +148,6 @@ Java_com_here_olp_network_HttpClient_completeRequest(
148148 downloaded_bytes, error, content_type);
149149}
150150
151- /*
152- * Reset request upon retry
153- */
154- extern " C" OLP_SDK_NETWORK_ANDROID_EXPORT void JNICALL
155- Java_com_here_olp_network_HttpClient_resetRequest (JNIEnv* env, jobject obj,
156- jlong request_id) {
157- auto network = olp::http::GetNetworkAndroidNativePtr (env, obj);
158- if (!network) {
159- OLP_SDK_LOG_WARNING (
160- kLogTag ,
161- " ResetRequest failed - network is invalid, request_id=" << request_id);
162- return ;
163- }
164- network->ResetRequest (env, request_id);
165- }
166-
167151NetworkAndroid::NetworkAndroid (size_t max_requests_count)
168152 : java_self_class_(nullptr ),
169153 jni_send_method_ (nullptr ),
@@ -396,10 +380,7 @@ bool NetworkAndroid::Initialize() {
396380 &Java_com_here_olp_network_HttpClient_dataCallback)},
397381 {" completeRequest" , " (JIIILjava/lang/String;Ljava/lang/String;)V" ,
398382 reinterpret_cast <void *>(
399- &Java_com_here_olp_network_HttpClient_completeRequest)},
400- {" resetRequest" , " (J)V" ,
401- reinterpret_cast <void *>(
402- &Java_com_here_olp_network_HttpClient_resetRequest)}};
383+ &Java_com_here_olp_network_HttpClient_completeRequest)}};
403384
404385 env->RegisterNatives (java_self_class_, methods,
405386 sizeof (methods) / sizeof (methods[0 ]));
@@ -715,21 +696,6 @@ void NetworkAndroid::CompleteRequest(JNIEnv* env, RequestId request_id,
715696 run_thread_ready_cv_.notify_all ();
716697}
717698
718- void NetworkAndroid::ResetRequest (JNIEnv* env, RequestId request_id) {
719- std::lock_guard<std::mutex> lock (requests_mutex_);
720- if (!started_) {
721- return ;
722- }
723-
724- auto req = requests_.find (request_id);
725- if (req == requests_.end ()) {
726- OLP_SDK_LOG_WARNING (kLogTag ,
727- " ResetRequest of unknown request_id=" << request_id);
728- return ;
729- }
730- req->second ->Reinitialize ();
731- }
732-
733699jobjectArray NetworkAndroid::CreateExtraHeaders (
734700 JNIEnv* env,
735701 const std::vector<std::pair<std::string, std::string> >& extra_headers) {
@@ -970,7 +936,6 @@ SendOutcome NetworkAndroid::Send(NetworkRequest request,
970936 .count ());
971937 const jint jproxy_port = static_cast <jint>(proxy_settings.GetPort ());
972938 const jint jproxy_type = static_cast <jint>(proxy_settings.GetType ());
973- const jint jmax_retries = 1 ;
974939 // Do sending
975940 {
976941 std::lock_guard<std::mutex> lock (requests_mutex_);
@@ -989,7 +954,7 @@ SendOutcome NetworkAndroid::Send(NetworkRequest request,
989954 auto task_obj = env.GetEnv ()->CallObjectMethod (
990955 obj_, jni_send_method_, jurl, jhttp_verb, jrequest_id,
991956 jconnection_timeout, jtransfer_timeout, jheaders, jbody, jproxy,
992- jproxy_port, jproxy_type, jmax_retries );
957+ jproxy_port, jproxy_type);
993958 if (env.GetEnv ()->ExceptionOccurred () || !task_obj) {
994959 OLP_SDK_LOG_ERROR (
995960 kLogTag , " Send failed - HttpClient error, url=" << request.GetUrl ());
0 commit comments