summaryrefslogtreecommitdiffstats
path: root/packages/StatementService/src/com/android/statementservice/retriever/DirectStatementRetriever.java
diff options
context:
space:
mode:
authorJoseph Wen <josephwen@google.com>2015-06-15 10:36:03 -0400
committerJoseph Wen <josephwen@google.com>2015-06-15 10:36:03 -0400
commit5fcbb9d0c17e073fb28c7169e80fa7bb8e61c6b1 (patch)
tree5bab917c65a5939e287ca2e92f87dcbf21ec4a10 /packages/StatementService/src/com/android/statementservice/retriever/DirectStatementRetriever.java
parent5d8c276bb91788441ec9a98717017eb01f1b348f (diff)
downloadframeworks_base-5fcbb9d0c17e073fb28c7169e80fa7bb8e61c6b1.zip
frameworks_base-5fcbb9d0c17e073fb28c7169e80fa7bb8e61c6b1.tar.gz
frameworks_base-5fcbb9d0c17e073fb28c7169e80fa7bb8e61c6b1.tar.bz2
Retry intent verification 3 times before failing.
BUG=21596311 Change-Id: Ia98925a4310046ef4d8117afe0b278e6a414dac6
Diffstat (limited to 'packages/StatementService/src/com/android/statementservice/retriever/DirectStatementRetriever.java')
-rw-r--r--packages/StatementService/src/com/android/statementservice/retriever/DirectStatementRetriever.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/packages/StatementService/src/com/android/statementservice/retriever/DirectStatementRetriever.java b/packages/StatementService/src/com/android/statementservice/retriever/DirectStatementRetriever.java
index e4feb90..9839329 100644
--- a/packages/StatementService/src/com/android/statementservice/retriever/DirectStatementRetriever.java
+++ b/packages/StatementService/src/com/android/statementservice/retriever/DirectStatementRetriever.java
@@ -36,6 +36,8 @@ import java.util.List;
private static final long DO_NOT_CACHE_RESULT = 0L;
private static final int HTTP_CONNECTION_TIMEOUT_MILLIS = 5000;
+ private static final int HTTP_CONNECTION_BACKOFF_MILLIS = 3000;
+ private static final int HTTP_CONNECTION_RETRY = 3;
private static final long HTTP_CONTENT_SIZE_LIMIT_IN_BYTES = 1024 * 1024;
private static final int MAX_INCLUDE_LEVEL = 1;
private static final String WELL_KNOWN_STATEMENT_PATH = "/.well-known/assetlinks.json";
@@ -151,9 +153,10 @@ import java.util.List;
&& !url.getProtocol().toLowerCase().equals("https")) {
return Result.create(statements, DO_NOT_CACHE_RESULT);
}
- webContent = mUrlFetcher.getWebContentFromUrl(url,
- HTTP_CONTENT_SIZE_LIMIT_IN_BYTES, HTTP_CONNECTION_TIMEOUT_MILLIS);
- } catch (IOException e) {
+ webContent = mUrlFetcher.getWebContentFromUrlWithRetry(url,
+ HTTP_CONTENT_SIZE_LIMIT_IN_BYTES, HTTP_CONNECTION_TIMEOUT_MILLIS,
+ HTTP_CONNECTION_BACKOFF_MILLIS, HTTP_CONNECTION_RETRY);
+ } catch (IOException | InterruptedException e) {
return Result.create(statements, DO_NOT_CACHE_RESULT);
}