summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2015-01-23 06:03:46 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-01-23 06:03:46 +0000
commitfbaf6b353dc9b7218b340acf629b06ae8e0101bb (patch)
treeb442b0b345fdbdc3b359bba6d7e9f307bdf775cc /core/java
parent83f58a2f7afac98199536b3090fe6f767ffb3a0d (diff)
parent78d51c2292b5a3b56be1b1e92bc67b70f4eebce4 (diff)
downloadframeworks_base-fbaf6b353dc9b7218b340acf629b06ae8e0101bb.zip
frameworks_base-fbaf6b353dc9b7218b340acf629b06ae8e0101bb.tar.gz
frameworks_base-fbaf6b353dc9b7218b340acf629b06ae8e0101bb.tar.bz2
am 78d51c22: Merge "Use the proper IpPrefix and LinkAddress constructors in VPN code." into lmp-mr1-dev
* commit '78d51c2292b5a3b56be1b1e92bc67b70f4eebce4': Use the proper IpPrefix and LinkAddress constructors in VPN code.
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/net/VpnService.java2
-rw-r--r--core/java/com/android/internal/net/VpnConfig.java9
2 files changed, 4 insertions, 7 deletions
diff --git a/core/java/android/net/VpnService.java b/core/java/android/net/VpnService.java
index f6b6978..c26af06 100644
--- a/core/java/android/net/VpnService.java
+++ b/core/java/android/net/VpnService.java
@@ -501,7 +501,7 @@ public class VpnService extends Service {
}
}
}
- mRoutes.add(new RouteInfo(new LinkAddress(address, prefixLength), null));
+ mRoutes.add(new RouteInfo(new IpPrefix(address, prefixLength), null));
mConfig.updateAllowedFamilies(address);
return this;
}
diff --git a/core/java/com/android/internal/net/VpnConfig.java b/core/java/com/android/internal/net/VpnConfig.java
index c5d9db4..921f1fe 100644
--- a/core/java/com/android/internal/net/VpnConfig.java
+++ b/core/java/com/android/internal/net/VpnConfig.java
@@ -24,6 +24,7 @@ import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.ResolveInfo;
import android.content.res.Resources;
+import android.net.IpPrefix;
import android.net.LinkAddress;
import android.net.Network;
import android.net.RouteInfo;
@@ -117,9 +118,7 @@ public class VpnConfig implements Parcelable {
String[] routes = routesStr.trim().split(" ");
for (String route : routes) {
//each route is ip/prefix
- String[] split = route.split("/");
- RouteInfo info = new RouteInfo(new LinkAddress
- (InetAddress.parseNumericAddress(split[0]), Integer.parseInt(split[1])), null);
+ RouteInfo info = new RouteInfo(new IpPrefix(route), null);
this.routes.add(info);
updateAllowedFamilies(info.getDestination().getAddress());
}
@@ -132,9 +131,7 @@ public class VpnConfig implements Parcelable {
String[] addresses = addressesStr.trim().split(" ");
for (String address : addresses) {
//each address is ip/prefix
- String[] split = address.split("/");
- LinkAddress addr = new LinkAddress(InetAddress.parseNumericAddress(split[0]),
- Integer.parseInt(split[1]));
+ LinkAddress addr = new LinkAddress(address);
this.addresses.add(addr);
updateAllowedFamilies(addr.getAddress());
}