summaryrefslogtreecommitdiffstats
path: root/core/java/android/net
diff options
context:
space:
mode:
authorRobert Greenwalt <robdroid@android.com>2009-08-19 11:45:32 -0700
committerRobert Greenwalt <robdroid@android.com>2009-08-19 16:34:41 -0700
commit60a45aff31541f65d39e4c4e7824cd1ea5a1e84c (patch)
tree0d37e3d944961d41499680813f62be90c40af48d /core/java/android/net
parent3c513ed95cee2e0bcd7208cb7e46307f09c907c9 (diff)
downloadframeworks_base-60a45aff31541f65d39e4c4e7824cd1ea5a1e84c.zip
frameworks_base-60a45aff31541f65d39e4c4e7824cd1ea5a1e84c.tar.gz
frameworks_base-60a45aff31541f65d39e4c4e7824cd1ea5a1e84c.tar.bz2
Fix Wifi+Cell on boot after wifi in use.
The gist of it is: Ignore reconnect fail of default APN during boot. A long path: 1 If wifi is started at boot it starts fast - before the PhoneService is available. 2 Wifi starts by failing - you get DISCONNECTED/Scanning events so CM starts the other default network (mobile). 3 Trying to restart mobile fails because the phone service isn't up yet. 4 The failure is noted and the net is marked as not-enabled. 5 The phone trys to auto-start the mobile network and succeeds, sending state-changed events 6 The CM ignores the state-changed events because the net isn't enabled (see 4). The long term fix is to remove two-way state tracking from the MobileDataStateTracker and instead just consume the state fed to us in state-change events. Near term fix is to not mark the default net disabled when we have failure (step 4) if the phone service isn't available.
Diffstat (limited to 'core/java/android/net')
-rw-r--r--core/java/android/net/MobileDataStateTracker.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/java/android/net/MobileDataStateTracker.java b/core/java/android/net/MobileDataStateTracker.java
index 85ee1ca..c5d6e11 100644
--- a/core/java/android/net/MobileDataStateTracker.java
+++ b/core/java/android/net/MobileDataStateTracker.java
@@ -316,6 +316,12 @@ public class MobileDataStateTracker extends NetworkStateTracker {
// no need to do anything - we're already due some status update intents
break;
case Phone.APN_REQUEST_FAILED:
+ if (mPhoneService == null && mApnType == Phone.APN_TYPE_DEFAULT) {
+ // on startup we may try to talk to the phone before it's ready
+ // just leave mEnabled as it is for the default apn.
+ return false;
+ }
+ // else fall through
case Phone.APN_TYPE_NOT_AVAILABLE:
mEnabled = false;
break;