summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/java/android/content/SyncManager.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/java/android/content/SyncManager.java b/core/java/android/content/SyncManager.java
index 58739dac6eb7..0bce748dab29 100644
--- a/core/java/android/content/SyncManager.java
+++ b/core/java/android/content/SyncManager.java
@@ -1375,10 +1375,10 @@ public class SyncManager implements OnAccountsUpdateListener {
long nextPendingSyncTime = Long.MAX_VALUE;
// Setting the value here instead of a method because we want the dumpsys logs
// to have the most recent value used.
- mDataConnectionIsConnected =
- getConnectivityManager().getActiveNetworkInfo().isConnected();
try {
waitUntilReadyToRun();
+ NetworkInfo info = getConnectivityManager().getActiveNetworkInfo();
+ mDataConnectionIsConnected = (info != null) && info.isConnected();
mSyncManagerWakeLock.acquire();
// Always do this first so that we be sure that any periodic syncs that
// are ready to run have been converted into pending syncs. This allows the