Make the VPN notice connectivity changes on stacked interfaces.

Currently, the VPN code only looks at base interfaces, so if
464xlat is in use, it will never disconnect when its underlying
network has disconnected. Use getAllInterfaceNames().contains()
instead of just comparing the base interface name.

Bug: 19336810
Change-Id: Id1ba2c80a09cec5098c6f512acdc0a05a939e9f3
This commit is contained in:
Lorenzo Colitti
2015-07-02 13:03:03 +09:00
parent 2bc8485ba7
commit 1b60d11b8f

View File

@@ -1135,7 +1135,7 @@ public class Vpn {
final ConnectivityManager cm = ConnectivityManager.from(mContext);
for (Network network : cm.getAllNetworks()) {
final LinkProperties lp = cm.getLinkProperties(network);
if (lp != null && mOuterInterface.equals(lp.getInterfaceName())) {
if (lp != null && lp.getAllInterfaceNames().contains(mOuterInterface)) {
final NetworkInfo networkInfo = cm.getNetworkInfo(network);
if (networkInfo != null) mOuterConnection.set(networkInfo.getType());
}