summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/android/java/src/org/chromium/net/NetworkChangeNotifier.java4
-rw-r--r--sync/android/java/src/org/chromium/sync/signin/AccountManagerHelper.java3
2 files changed, 6 insertions, 1 deletions
diff --git a/net/android/java/src/org/chromium/net/NetworkChangeNotifier.java b/net/android/java/src/org/chromium/net/NetworkChangeNotifier.java
index 58360b4..a5de983 100644
--- a/net/android/java/src/org/chromium/net/NetworkChangeNotifier.java
+++ b/net/android/java/src/org/chromium/net/NetworkChangeNotifier.java
@@ -67,6 +67,10 @@ public class NetworkChangeNotifier {
return sInstance;
}
+ public static boolean isInitialized() {
+ return sInstance != null;
+ }
+
static void resetInstanceForTests(Context context) {
sInstance = new NetworkChangeNotifier(context);
}
diff --git a/sync/android/java/src/org/chromium/sync/signin/AccountManagerHelper.java b/sync/android/java/src/org/chromium/sync/signin/AccountManagerHelper.java
index 7952f4e..2c3441a 100644
--- a/sync/android/java/src/org/chromium/sync/signin/AccountManagerHelper.java
+++ b/sync/android/java/src/org/chromium/sync/signin/AccountManagerHelper.java
@@ -246,7 +246,8 @@ public class AccountManagerHelper {
@Override
public void onPostExecute(String authToken) {
if (authToken != null || !errorEncountered.get() ||
- numTries.incrementAndGet() == MAX_TRIES) {
+ numTries.incrementAndGet() == MAX_TRIES ||
+ !NetworkChangeNotifier.isInitialized()) {
callback.tokenAvailable(authToken);
return;
}