summaryrefslogtreecommitdiffstats
path: root/sync/android
diff options
context:
space:
mode:
authorkhushalsagar <khushalsagar@chromium.org>2015-08-27 13:36:25 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-27 20:37:10 +0000
commit8148b0974c04fd08e1a1eba73b441fb5329ea25c (patch)
treedf78387aaf161e3f21e02f8cc639362e75ad9d42 /sync/android
parentaad6baf8d56f258d67f1c0cc200a59fbd666dbf9 (diff)
downloadchromium_src-8148b0974c04fd08e1a1eba73b441fb5329ea25c.zip
chromium_src-8148b0974c04fd08e1a1eba73b441fb5329ea25c.tar.gz
chromium_src-8148b0974c04fd08e1a1eba73b441fb5329ea25c.tar.bz2
[Part 2] CacheInvalidation Library Update to use GCM in GMSCore.
The change adds: 1) ChromeGcmListenerService to receive GCM messages sent to the application. 2) InvalidationGcmUpstreamSender to send upstream messages for invalidations using GCM and record UMA stats. 3) Updates the manifest to include the services and changes the channel initialization call. The call has been moved to InvalidationController since it registers the application with GCM for invalidations only. The other user of GCM is Web Push which currently uses GoogleCloudMessagingV2 for registration. Part 1: https://codereview.chromium.org/1300923002/ BUG=397327, 477059 Review URL: https://codereview.chromium.org/1289203006 Cr-Commit-Position: refs/heads/master@{#345975}
Diffstat (limited to 'sync/android')
-rw-r--r--sync/android/java/src/org/chromium/sync/signin/ChromeSigninController.java36
1 files changed, 1 insertions, 35 deletions
diff --git a/sync/android/java/src/org/chromium/sync/signin/ChromeSigninController.java b/sync/android/java/src/org/chromium/sync/signin/ChromeSigninController.java
index 4a5e8e8..cd86532 100644
--- a/sync/android/java/src/org/chromium/sync/signin/ChromeSigninController.java
+++ b/sync/android/java/src/org/chromium/sync/signin/ChromeSigninController.java
@@ -6,12 +6,9 @@ package org.chromium.sync.signin;
import android.accounts.Account;
import android.content.Context;
-import android.os.AsyncTask;
import android.preference.PreferenceManager;
import android.util.Log;
-import com.google.ipc.invalidation.external.client.contrib.MultiplexingGcmListener;
-
import org.chromium.base.ObserverList;
import org.chromium.base.VisibleForTesting;
import org.chromium.sync.AndroidSyncSettings;
@@ -44,8 +41,6 @@ public class ChromeSigninController {
private final ObserverList<Listener> mListeners = new ObserverList<Listener>();
- private boolean mGcmInitialized;
-
private ChromeSigninController(Context context) {
mApplicationContext = context.getApplicationContext();
AndroidSyncSettings.updateAccount(context, getSignedInUser());
@@ -115,33 +110,4 @@ public class ChromeSigninController {
public void removeListener(Listener listener) {
mListeners.removeObserver(listener);
}
-
- /**
- * Registers for Google Cloud Messaging (GCM) if there is no existing registration.
- */
- public void ensureGcmIsInitialized() {
- if (mGcmInitialized) return;
- mGcmInitialized = true;
- new AsyncTask<Void, Void, Void>() {
- @Override
- protected Void doInBackground(Void... arg0) {
- try {
- String regId = MultiplexingGcmListener.initializeGcm(mApplicationContext);
- if (!regId.isEmpty()) Log.d(TAG, "Already registered with GCM");
- } catch (IllegalStateException exception) {
- Log.w(TAG, "Application manifest does not correctly configure GCM; "
- + "sync notifications will not work", exception);
- } catch (UnsupportedOperationException exception) {
- Log.w(TAG, "Device does not support GCM; sync notifications will not work",
- exception);
- }
- return null;
- }
- }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
- }
-
- @VisibleForTesting
- public boolean isGcmInitialized() {
- return mGcmInitialized;
- }
-}
+} \ No newline at end of file