mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
Banglejs: set the HTTP request timeout as specified
This commit is contained in:
+5
@@ -58,6 +58,7 @@ import androidx.core.text.HtmlCompat;
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
|
||||
import com.android.volley.AuthFailureError;
|
||||
import com.android.volley.DefaultRetryPolicy;
|
||||
import com.android.volley.Request;
|
||||
import com.android.volley.RequestQueue;
|
||||
import com.android.volley.Response;
|
||||
@@ -998,6 +999,10 @@ public class BangleJSDeviceSupport extends AbstractBTLEDeviceSupport {
|
||||
return h;
|
||||
}
|
||||
};
|
||||
if (json.has("timeout")) {
|
||||
int timeout = json.getInt("timeout");
|
||||
stringRequest.setRetryPolicy(new DefaultRetryPolicy(timeout, 0, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
|
||||
}
|
||||
RequestQueue queue = getRequestQueue();
|
||||
queue.add(stringRequest);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user