diff options
author | clamy@chromium.org <clamy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-06 12:09:00 +0000 |
---|---|---|
committer | clamy@chromium.org <clamy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-06 12:09:00 +0000 |
commit | 335c2c0476a04ea8bf1a0490da291f7872665806 (patch) | |
tree | 83659a2dd082d3985d69ce44a81b7d985d878b11 /net | |
parent | b3017b24f9c555003dfc92d61144d4e5a3c3dfdd (diff) | |
download | chromium_src-335c2c0476a04ea8bf1a0490da291f7872665806.zip chromium_src-335c2c0476a04ea8bf1a0490da291f7872665806.tar.gz chromium_src-335c2c0476a04ea8bf1a0490da291f7872665806.tar.bz2 |
Add retry function to AccountManagerHelper when called from foreground
On Android, after encountering an IO exception, the AccountManagerHelper method
to get the authentication token from foreground now retries when the network is
back.
BUG=165687
Review URL: https://chromiumcodereview.appspot.com/12091069
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180961 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/android/java/src/org/chromium/net/NetworkChangeNotifier.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/net/android/java/src/org/chromium/net/NetworkChangeNotifier.java b/net/android/java/src/org/chromium/net/NetworkChangeNotifier.java index 5710e83..b161a86 100644 --- a/net/android/java/src/org/chromium/net/NetworkChangeNotifier.java +++ b/net/android/java/src/org/chromium/net/NetworkChangeNotifier.java @@ -209,4 +209,12 @@ public class NetworkChangeNotifier { public static NetworkChangeNotifierAutoDetect getAutoDetectorForTest() { return getInstance().mAutoDetector; } + + /** + * Checks if there currently is connectivity. + */ + public static boolean isOnline() { + int connectionType = getInstance().getCurrentConnectionType(); + return connectionType != CONNECTION_UNKNOWN && connectionType != CONNECTION_NONE; + } } |