Chromium Code Reviews| 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 d6057db320ecb29b52725d6b63716bbf803bc6c6..fa674a810a39167c18e453e02b774700067faa49 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 |
| @@ -58,6 +58,9 @@ public class WebappDataStorage { |
| static final String KEY_DID_LAST_WEBAPK_UPDATE_REQUEST_SUCCEED = |
| "did_last_webapk_update_request_succeed"; |
| + // Whether to check updates less frequently. |
| + static final String KEY_INFREQUENT_UPDATES = "infrequent_updates"; |
| + |
| // 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; |
| @@ -301,6 +304,7 @@ public class WebappDataStorage { |
| editor.remove(KEY_LAST_CHECK_WEB_MANIFEST_UPDATE_TIME); |
| editor.remove(KEY_LAST_WEBAPK_UPDATE_REQUEST_COMPLETE_TIME); |
| editor.remove(KEY_DID_LAST_WEBAPK_UPDATE_REQUEST_SUCCEED); |
| + editor.remove(KEY_INFREQUENT_UPDATES); |
| editor.apply(); |
| } |
| @@ -401,6 +405,20 @@ public class WebappDataStorage { |
| return mPreferences.getBoolean(KEY_DID_LAST_WEBAPK_UPDATE_REQUEST_SUCCEED, false); |
| } |
| + /** |
| + * Updates the result of whether to check updates less frequently. |
|
pkotwicz
2017/02/10 20:53:14
Nit: "Updates the result of whether" -> "Updates w
Xi Han
2017/02/13 22:56:14
Done.
|
| + */ |
| + void updateInfrequentUpdates(boolean isInfrequentUpdates) { |
| + mPreferences.edit().putBoolean(KEY_INFREQUENT_UPDATES, isInfrequentUpdates).apply(); |
| + } |
| + |
| + /** |
| + * Returns whether to check updates less frequently. |
| + */ |
| + boolean getInfrequentUpdates() { |
| + return mPreferences.getBoolean(KEY_INFREQUENT_UPDATES, false); |
| + } |
| + |
| protected WebappDataStorage(String webappId) { |
| mId = webappId; |
| mPreferences = ContextUtils.getApplicationContext().getSharedPreferences( |