Chromium Code Reviews| 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; |
|
Alexei Svitkine (slow)
2015/11/12 19:03:22
Add a comment.
Alexander Agulenko
2015/11/12 19:50:09
Done.
|
| public VariationsSeedService() { |
| super(TAG); |
| @@ -33,10 +34,16 @@ public class VariationsSeedService extends IntentService { |
| @Override |
| public void onHandleIntent(Intent intent) { |
| + if (sFetchInProgress || VariationsSeedBridge.hasJavaPref(getApplicationContext()) |
|
Alexei Svitkine (slow)
2015/11/12 19:03:22
Add a comment.
Alexander Agulenko
2015/11/12 19:50:09
Done.
|
| + || 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; |
| } |
| } |