Index: chrome/android/java/src/org/chromium/chrome/browser/invalidation/InvalidationController.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/invalidation/InvalidationController.java b/chrome/android/java/src/org/chromium/chrome/browser/invalidation/InvalidationController.java |
index d9b566713aead4f816ef98e1691ac52eba84092c..8e3cac34a841f81c5c37116e3ee967ea96494b1a 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/invalidation/InvalidationController.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/invalidation/InvalidationController.java |
@@ -11,7 +11,8 @@ import android.content.Intent; |
import com.google.common.annotations.VisibleForTesting; |
import com.google.common.base.Preconditions; |
-import org.chromium.base.ActivityStatus; |
+import org.chromium.base.ApplicationState; |
+import org.chromium.base.ApplicationStatus; |
import org.chromium.base.CalledByNative; |
import org.chromium.sync.internal_api.pub.base.ModelType; |
import org.chromium.sync.notifier.InvalidationClientNameProvider; |
@@ -26,7 +27,7 @@ import java.util.Set; |
* Controller used to send start, stop, and registration-change commands to the invalidation |
* client library used by Sync. |
*/ |
-public class InvalidationController implements ActivityStatus.StateListener { |
+public class InvalidationController implements ApplicationStatus.ApplicationStateListener { |
private static final Object LOCK = new Object(); |
private static InvalidationController sInstance; |
@@ -119,16 +120,16 @@ public class InvalidationController implements ActivityStatus.StateListener { |
@VisibleForTesting |
InvalidationController(Context context) { |
mContext = Preconditions.checkNotNull(context.getApplicationContext()); |
- ActivityStatus.registerStateListener(this); |
+ ApplicationStatus.registerApplicationStateListener(this); |
} |
@Override |
- public void onActivityStateChange(int newState) { |
+ public void onApplicationStateChange(int newState) { |
if (SyncStatusHelper.get(mContext).isSyncEnabled()) { |
- if (newState == ActivityStatus.PAUSED) { |
- stop(); |
- } else if (newState == ActivityStatus.RESUMED) { |
+ if (newState == ApplicationState.HAS_RUNNING_ACTIVITIES) { |
start(); |
+ } else if (newState == ApplicationState.HAS_PAUSED_ACTIVITIES) { |
+ stop(); |
} |
} |
} |