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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkUpdateManager.java

Issue 2790213004: Don't try to update incessently when Shell APK version is out of date. (Closed)
Patch Set: Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.chrome.browser.webapps; 5 package org.chromium.chrome.browser.webapps;
6 6
7 import android.content.pm.PackageInfo; 7 import android.content.pm.PackageInfo;
8 import android.content.pm.PackageManager; 8 import android.content.pm.PackageManager;
9 import android.graphics.Bitmap; 9 import android.graphics.Bitmap;
10 import android.text.TextUtils; 10 import android.text.TextUtils;
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 return false; 280 return false;
281 } 281 }
282 282
283 if (CommandLine.getInstance().hasSwitch( 283 if (CommandLine.getInstance().hasSwitch(
284 ChromeSwitches.CHECK_FOR_WEB_MANIFEST_UPDATE_ON_STARTUP)) { 284 ChromeSwitches.CHECK_FOR_WEB_MANIFEST_UPDATE_ON_STARTUP)) {
285 return true; 285 return true;
286 } 286 }
287 287
288 if (!ChromeWebApkHost.areUpdatesEnabled()) return false; 288 if (!ChromeWebApkHost.areUpdatesEnabled()) return false;
289 289
290 if (isShellApkVersionOutOfDate(info)) return true; 290 if (isShellApkVersionOutOfDate(info) && mStorage.shouldRequestShellApkUp date()) return true;
pkotwicz 2017/04/04 22:29:57 Can we remove this if(){} statement entirely? I th
Xi Han 2017/04/05 17:19:09 I think 3 day is also good, but we'd better not wa
291 291
292 return mStorage.shouldCheckForUpdate(); 292 return mStorage.shouldCheckForUpdate();
293 } 293 }
294 294
295 /** 295 /**
296 * Updates {@link WebappDataStorage} with the time of the latest WebAPK upda te and whether the 296 * Updates {@link WebappDataStorage} with the time of the latest WebAPK upda te and whether the
297 * WebAPK update succeeded. 297 * WebAPK update succeeded.
298 */ 298 */
299 private static void recordUpdate(WebappDataStorage storage, 299 private static void recordUpdate(WebappDataStorage storage,
300 @WebApkInstallResult.WebApkInstallResultEnum int result, boolean rel axUpdates) { 300 @WebApkInstallResult.WebApkInstallResultEnum int result, boolean rel axUpdates) {
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 366
367 recordUpdate(storage, result, relaxUpdates); 367 recordUpdate(storage, result, relaxUpdates);
368 } 368 }
369 369
370 private static native void nativeUpdateAsync(String id, String startUrl, Str ing scope, 370 private static native void nativeUpdateAsync(String id, String startUrl, Str ing scope,
371 String name, String shortName, String bestIconUrl, Bitmap bestIcon, String[] iconUrls, 371 String name, String shortName, String bestIconUrl, Bitmap bestIcon, String[] iconUrls,
372 String[] iconHashes, int displayMode, int orientation, long themeCol or, 372 String[] iconHashes, int displayMode, int orientation, long themeCol or,
373 long backgroundColor, String manifestUrl, String webApkPackage, int webApkVersion, 373 long backgroundColor, String manifestUrl, String webApkPackage, int webApkVersion,
374 boolean isManifestStale); 374 boolean isManifestStale);
375 } 375 }
OLDNEW
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698