diff options
author | Robert Greenwalt <rgreenwalt@google.com> | 2011-04-01 14:11:30 -0700 |
---|---|---|
committer | Robert Greenwalt <rgreenwalt@google.com> | 2011-04-01 14:11:30 -0700 |
commit | 92d72ca01ba1c9e6cfed318a86287ffd0cc2c385 (patch) | |
tree | 5dd762fe3b15cfdd50eb7dcc8418d275fb4bff18 /core | |
parent | 64802ca780563e2bd715a300e0bb81eec643baf0 (diff) | |
download | frameworks_base-92d72ca01ba1c9e6cfed318a86287ffd0cc2c385.zip frameworks_base-92d72ca01ba1c9e6cfed318a86287ffd0cc2c385.tar.gz frameworks_base-92d72ca01ba1c9e6cfed318a86287ffd0cc2c385.tar.bz2 |
Fix bad merge.
Add host route for a default gateway before adding the default route.
Also fixing bug were "already active" condtion of APN failed to
propagate the default gateway info, resulting in a loss of that address.
bug:4175328
Change-Id: I38f9d108693382a43e6605d56ca3963adf4eb6f4
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/net/MobileDataStateTracker.java | 4 | ||||
-rw-r--r-- | core/java/android/net/NetworkStateTracker.java | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/core/java/android/net/MobileDataStateTracker.java b/core/java/android/net/MobileDataStateTracker.java index 32c2d64..04b0f12 100644 --- a/core/java/android/net/MobileDataStateTracker.java +++ b/core/java/android/net/MobileDataStateTracker.java @@ -247,6 +247,9 @@ public class MobileDataStateTracker extends NetworkStateTracker { Log.d(TAG, "CONNECTED event did not supply interface name."); } mDefaultGatewayAddr = intent.getIntExtra(Phone.DATA_GATEWAY_KEY, 0); + if (mDefaultGatewayAddr == 0) { + Log.d(TAG, "CONNECTED event did not supply a default gateway."); + } setDetailedState(DetailedState.CONNECTED, reason, apnName); break; } @@ -385,6 +388,7 @@ public class MobileDataStateTracker extends NetworkStateTracker { intent.putExtra(Phone.DATA_APN_KEY, mApnName); intent.putExtra(Phone.DATA_IFACE_NAME_KEY, mInterfaceName); intent.putExtra(Phone.NETWORK_UNAVAILABLE_KEY, false); + intent.putExtra(Phone.DATA_GATEWAY_KEY, mDefaultGatewayAddr); if (mStateReceiver != null) mStateReceiver.onReceive(mContext, intent); break; case Phone.APN_REQUEST_STARTED: diff --git a/core/java/android/net/NetworkStateTracker.java b/core/java/android/net/NetworkStateTracker.java index 1e8dedc..233ad21 100644 --- a/core/java/android/net/NetworkStateTracker.java +++ b/core/java/android/net/NetworkStateTracker.java @@ -172,6 +172,7 @@ public abstract class NetworkStateTracker extends Handler { if (inetAddress == null) { if (DBG) Log.d(TAG, " Unable to add default route. mDefaultGatewayAddr Error"); } else { + NetworkUtils.addHostRoute(mInterfaceName, inetAddress, null); if (!NetworkUtils.addDefaultRoute(mInterfaceName, inetAddress) && DBG) { Log.d(TAG, " Unable to add default route."); } |