summaryrefslogtreecommitdiffstats
path: root/sync
diff options
context:
space:
mode:
authordfalcantara@chromium.org <dfalcantara@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-17 17:52:58 +0000
committerdfalcantara@chromium.org <dfalcantara@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-17 17:52:58 +0000
commit1707654f83f93ccafce142bc2565c8ce431542e0 (patch)
tree1bd246134b3fcacb1528aa42cbffa003839e95f5 /sync
parent0dac61ea5928fbd3b61455faf7113e31adf00515 (diff)
downloadchromium_src-1707654f83f93ccafce142bc2565c8ce431542e0.zip
chromium_src-1707654f83f93ccafce142bc2565c8ce431542e0.tar.gz
chromium_src-1707654f83f93ccafce142bc2565c8ce431542e0.tar.bz2
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
Diffstat (limited to 'sync')
-rw-r--r--sync/android/java/src/org/chromium/sync/notifier/InvalidationService.java9
1 files changed, 1 insertions, 8 deletions
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. */