| Index: chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java
|
| index 3aafbd3bec438d2d145808aba95ddb28c4857f52..b1ae7da7f0e3f120f5d4f21d6a14b6f08c0e5677 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java
|
| @@ -74,6 +74,10 @@ public class WebappDataStorage {
|
| // server if the previous update attempt failed.
|
| public static final long RETRY_UPDATE_DURATION = TimeUnit.HOURS.toMillis(12L);
|
|
|
| + // Number of milliseconds to wait before re-questing an update for shell APK if the previous
|
| + // update attempt failed.
|
| + public static final long RETRY_SHELL_APK_UPDATE_DURATION = TimeUnit.DAYS.toMillis(2L);
|
| +
|
| // Unset/invalid constants for last used times and URLs. 0 is used as the null last used time as
|
| // WebappRegistry assumes that this is always a valid timestamp.
|
| static final long LAST_USED_UNSET = 0;
|
| @@ -474,6 +478,13 @@ public class WebappDataStorage {
|
| && !didPreviousUpdateSucceed();
|
| }
|
|
|
| + /** Returns whether we should request shell APK update. */
|
| + boolean shouldRequestShellApkUpdate() {
|
| + long sinceLastRequestDurationMs =
|
| + sClock.currentTimeMillis() - getLastWebApkUpdateRequestCompletionTime();
|
| + return sinceLastRequestDurationMs >= RETRY_SHELL_APK_UPDATE_DURATION;
|
| + }
|
| +
|
| protected WebappDataStorage(String webappId) {
|
| mId = webappId;
|
| mPreferences = ContextUtils.getApplicationContext().getSharedPreferences(
|
|
|