From 1707654f83f93ccafce142bc2565c8ce431542e0 Mon Sep 17 00:00:00 2001 From: "dfalcantara@chromium.org" Date: Thu, 17 Oct 2013 17:52:58 +0000 Subject: Add visibility check to [ActivityStatus] Some Java code checks to see whether Chrome is in the foreground when it should really be checking if the Application's top Activity is visible for scenarios where a little popup partially covers Chrome. Add a method to make the check more explicit, then change obvious places that do checks on whether Chrome is running to use the new function. Precursor to https://gerrit-int.chromium.org/#/c/45073/ BUG=308211 R=nyquist@chromium.org, tedchoc@chromium.org, yfriedman@chromium.org Review URL: https://codereview.chromium.org/27509007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@229172 0039d316-1c4b-4281-b951-d872f2087c98 --- .../java/src/org/chromium/sync/notifier/InvalidationService.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'sync') diff --git a/sync/android/java/src/org/chromium/sync/notifier/InvalidationService.java b/sync/android/java/src/org/chromium/sync/notifier/InvalidationService.java index 2d63802..536f3b1 100644 --- a/sync/android/java/src/org/chromium/sync/notifier/InvalidationService.java +++ b/sync/android/java/src/org/chromium/sync/notifier/InvalidationService.java @@ -476,14 +476,7 @@ public class InvalidationService extends AndroidListener { */ @VisibleForTesting boolean isChromeInForeground() { - switch (ActivityStatus.getState()) { - case ActivityStatus.CREATED: - case ActivityStatus.STARTED: - case ActivityStatus.RESUMED: - return true; - default: - return false; - } + return ActivityStatus.isApplicationVisible(); } /** Returns whether the notification client has been started, for tests. */ -- cgit v1.1