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

Unified Diff: components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java

Issue 1437833002: Added check for avoid repeating variations first run seed fetch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Implemented marking seed storing as successful from C++ side Created 5 years, 1 month 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: components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java
diff --git a/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java b/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java
index c752d884b1fb67c05c0648f2f4bd1d2de2d90f26..5f6d0c07e95591b42f70179d00c65e0f10ac8f38 100644
--- a/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java
+++ b/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java
@@ -26,6 +26,7 @@ public class VariationsSeedService extends IntentService {
private static final int BUFFER_SIZE = 4096;
private static final int READ_TIMEOUT = 10000; // time in ms
private static final int REQUEST_TIMEOUT = 15000; // time in ms
+ private static boolean sFetchInProgress = false;
public VariationsSeedService() {
super(TAG);
@@ -33,10 +34,16 @@ public class VariationsSeedService extends IntentService {
@Override
public void onHandleIntent(Intent intent) {
+ if (sFetchInProgress || VariationsSeedBridge.hasJavaPref(getApplicationContext())
+ || VariationsSeedBridge.hasNativePref(getApplicationContext())) {
+ return;
+ }
try {
downloadContent(new URL(VARIATIONS_SERVER_URL));
} catch (MalformedURLException e) {
Log.w(TAG, "Variations server URL is malformed.", e);
+ } finally {
+ sFetchInProgress = false;
Steven Holte 2015/11/12 19:33:19 Where do you set sFetchInProgress = true?
Alexander Agulenko 2015/11/12 22:06:47 Seems like I occasionally removed it (maybe simply
}
}

Powered by Google App Engine
This is Rietveld 408576698