Volley 请求重试策略不考虑超时

Ali*_*ali 11 java android request-timed-out android-volley retrypolicy

我在DefaultRetryPolicy中将 1500 设置为initialTimeoutMs如下,但它不考虑超时:

request.setRetryPolicy(new DefaultRetryPolicy(1500
        , DefaultRetryPolicy.DEFAULT_MAX_RETRIES
        , DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
Run Code Online (Sandbox Code Playgroud)

我断开了设备上的 WiFi 以测试它的超时,我在Logcat 中看到了这些时间:

2019-12-16 14:28:15.892 I/MyClass: request sent
2019-12-16 14:28:35.930 I/MyClass: request caught onError
Run Code Online (Sandbox Code Playgroud)

我期望在 1.5 秒后捕获 onResponse 或 onError 花了 20 多秒!!!