From f336d722c773855402d91a227fc290eafca23335 Mon Sep 17 00:00:00 2001 From: Chad Brubaker Date: Mon, 15 Jul 2013 16:34:04 -0700 Subject: Fix supplimentary network connections with VPNs Enables the use of supplimentary mobile networks like MMS, and HIPRI while VPNs are running. Change-Id: I313f57a905b4e16bd4322c68687cbff1cfbe9d3e --- core/java/android/net/ConnectivityManager.java | 16 ++++++++++++++++ core/java/android/os/INetworkManagementService.aidl | 12 ++++++++++++ 2 files changed, 28 insertions(+) (limited to 'core/java/android') diff --git a/core/java/android/net/ConnectivityManager.java b/core/java/android/net/ConnectivityManager.java index f920874..8bbe6c8 100644 --- a/core/java/android/net/ConnectivityManager.java +++ b/core/java/android/net/ConnectivityManager.java @@ -480,6 +480,22 @@ public class ConnectivityManager { } /** + * Checks if the given network type should be exempt from VPN routing rules + * + * @hide + */ + public static boolean isNetworkTypeExempt(int networkType) { + switch (networkType) { + case TYPE_MOBILE_MMS: + case TYPE_MOBILE_SUPL: + case TYPE_MOBILE_HIPRI: + return true; + default: + return false; + } + } + + /** * Specifies the preferred network type. When the device has more * than one type available the preferred network type will be used. * Note that this made sense when we only had 2 network types, diff --git a/core/java/android/os/INetworkManagementService.aidl b/core/java/android/os/INetworkManagementService.aidl index 51c367a..ed9620f 100644 --- a/core/java/android/os/INetworkManagementService.aidl +++ b/core/java/android/os/INetworkManagementService.aidl @@ -19,6 +19,7 @@ package android.os; import android.net.InterfaceConfiguration; import android.net.INetworkManagementEventObserver; +import android.net.LinkAddress; import android.net.NetworkStats; import android.net.RouteInfo; import android.net.wifi.WifiConfiguration; @@ -388,6 +389,17 @@ interface INetworkManagementService void clearMarkedForwardingRoute(String iface, in RouteInfo route); /** + * Exempts {@code host} from the routing set up by {@link setMarkedForwardingRoute} + * All connects to {@code host} will use the global routing table + */ + void setHostExemption(in LinkAddress host); + + /** + * Clears an exemption set by {@link setHostExemption} + */ + void clearHostExemption(in LinkAddress host); + + /** * Set a process (pid) to use the name servers associated with the specified interface. */ void setDnsInterfaceForPid(String iface, int pid); -- cgit v1.1