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

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

Issue 1437833004: Implemented clearing Java prefs after pulling variations first run seed from Java to C++ side (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merged with CL 1437833002 + fixed some code review comments 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;
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;
}
}

Powered by Google App Engine
This is Rietveld 408576698