From 8206ff30c23c76851bebc8d72a65e65b0f7f9a29 Mon Sep 17 00:00:00 2001 From: Robert Greenwalt Date: Thu, 10 Sep 2009 15:06:20 -0700 Subject: Fix for multi-apn MMS access. Mark cellular variants with the same availability, regardless of which are currently in use. Availability just means the radio is enabled and sees the network, but has no guarantees that we could connect to an APN if requested. Fix the requestRouteToHost logic to support apn switches without WIFI. bug:2093841 --- .../java/com/android/server/ConnectivityService.java | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'services') diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java index e26dd13..408a4d2 100644 --- a/services/java/com/android/server/ConnectivityService.java +++ b/services/java/com/android/server/ConnectivityService.java @@ -640,20 +640,14 @@ public class ConnectivityService extends IConnectivityManager.Stub { return false; } NetworkStateTracker tracker = mNetTrackers[networkType]; - /* - * If there's only one connected network, and it's the one requested, - * then we don't have to do anything - the requested route already - * exists. If it's not the requested network, then it's not possible - * to establish the requested route. Finally, if there is more than - * one connected network, then we must insert an entry in the routing - * table. - */ - if (getNumConnectedNetworks() > 1) { - return tracker.requestRouteToHost(hostAddress); - } else { - return (mNetAttributes[networkType].isDefault() && - tracker.getNetworkInfo().isConnected()); + + if (!tracker.getNetworkInfo().isConnected() || tracker.isTeardownRequested()) { + if (DBG) { + Log.d(TAG, "requestRouteToHost on down network (" + networkType + " - dropped"); + } + return false; } + return tracker.requestRouteToHost(hostAddress); } /** -- cgit v1.1