Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(917)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java

Issue 2948713002: Update WebAPK after the user closes WebAPK
Patch Set: Merge branch 'background_updates4' into background_updates Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 b8d8ffaa5f82d6f8c7eb07a882da5d47eadb1841..5f2f6f921a2681850b587ce172cfbf1ab39cd219 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
@@ -62,9 +62,6 @@ public class WebappDataStorage {
// Whether the last WebAPK update request succeeded.
static final String KEY_DID_LAST_UPDATE_REQUEST_SUCCEED = "did_last_update_request_succeed";
- // The number of times that updating a WebAPK in the background has been requested.
- static final String KEY_UPDATE_REQUESTED = "update_requested";
-
// Whether to check updates less frequently.
static final String KEY_RELAX_UPDATES = "relax_updates";
@@ -86,7 +83,7 @@ public class WebappDataStorage {
// Number of milliseconds to wait before re-requesting an updated WebAPK from the WebAPK
// server if the previous update attempt failed.
- public static final long RETRY_UPDATE_DURATION = TimeUnit.HOURS.toMillis(12L);
+ public static final long RETRY_UPDATE_DURATION = TimeUnit.DAYS.toMillis(1L);
// The default shell Apk version of WebAPKs.
static final int DEFAULT_SHELL_APK_VERSION = 1;
@@ -331,7 +328,6 @@ public class WebappDataStorage {
editor.remove(KEY_LAST_CHECK_WEB_MANIFEST_UPDATE_TIME);
editor.remove(KEY_LAST_UPDATE_REQUEST_COMPLETE_TIME);
editor.remove(KEY_DID_LAST_UPDATE_REQUEST_SUCCEED);
- editor.remove(KEY_UPDATE_REQUESTED);
editor.remove(KEY_RELAX_UPDATES);
editor.remove(KEY_DISMISSED_DISCLOSURE);
editor.apply();
@@ -464,27 +460,6 @@ public class WebappDataStorage {
return mPreferences.getBoolean(KEY_DISMISSED_DISCLOSURE, false);
}
- /**
- * Increases the number of times that update has been requested for the WebAPK by 1.
- */
- void recordUpdateRequest() {
- mPreferences.edit().putInt(KEY_UPDATE_REQUESTED, getUpdateRequests() + 1).apply();
- }
-
- /**
- * Resets the number of times that update has been requested for the WebAPK.
- */
- void resetUpdateRequests() {
- mPreferences.edit().remove(KEY_UPDATE_REQUESTED).apply();
- }
-
- /**
- * Returns the number of times that update has been requested for this WebAPK.
- */
- int getUpdateRequests() {
- return mPreferences.getInt(KEY_UPDATE_REQUESTED, 0);
- }
-
/** Updates the shell Apk version requested in the last update. */
void updateLastRequestedShellApkVersion(int shellApkVersion) {
mPreferences.edit().putInt(KEY_LAST_REQUESTED_SHELL_APK_VERSION, shellApkVersion).apply();

Powered by Google App Engine
This is Rietveld 408576698