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

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

Issue 1417733008: Java code for fetching variations first run seed after receiving chrome.TOS_ACKED broadcast. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor fixes: changed comments and removed unused includes and usings 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/VariationsSeedServiceLauncher.java
diff --git a/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedServiceLauncher.java b/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedServiceLauncher.java
new file mode 100644
index 0000000000000000000000000000000000000000..8cf05f59fac53c21312e589b0ae63b0ea794a7b2
--- /dev/null
+++ b/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedServiceLauncher.java
@@ -0,0 +1,28 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.components.variations.firstrun;
+
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+
+/**
+ * This receiver is notified when a user goes through the Setup Wizard and acknowledges
+ * the Chrome ToS and after that we start a variations service to fetch variations seed
+ * before the actual first Chrome launch.
+ *
+ * TODO(agulenko): Implement working with another broadcast (e.g. connectivity change)
+ * since chrome.TOS_ACKED won't be broadcasted in Android N.
+ */
+public class VariationsSeedServiceLauncher extends BroadcastReceiver {
+ private static final String TAG = "VariationsSeedServiceLauncher";
+
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ // Start of service to fetch variations seed from the server to use it on Chrome first run
+ Intent serviceIntent = new Intent(context, VariationsSeedService.class);
newt (away) 2015/11/06 18:27:15 We should check whether we've already downloaded t
Alexander Agulenko 2015/11/06 19:54:38 Acknowledged. Since we currently use chrome.TOS_A
+ context.startService(serviceIntent);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698