more fixes for VPN but not quite ready yet

This commit is contained in:
Nathan Freitas 2014-11-13 13:40:50 -05:00
parent 7f50f79b0e
commit 3ef94e009c
1 changed files with 10 additions and 1 deletions

View File

@ -16,6 +16,7 @@
package org.torproject.android.vpn;
import java.io.IOException;
import java.net.InetAddress;
import java.nio.ByteBuffer;
import java.util.Locale;
@ -98,6 +99,14 @@ public class OrbotVpnService extends VpnService implements Handler.Callback {
if (mProxyServer != null)
mProxyServer.stop();
if (mInterface != null)
try {
mInterface.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
@Override
@ -136,7 +145,7 @@ public class OrbotVpnService extends VpnService implements Handler.Callback {
//builder.addRoute("192.168.43.0",8);
builder.addDnsServer("8.8.8.8");
// Create a new interface using the builder and save the parameters.
// Create a new interface using the builder and save the parameters.
mInterface = builder.setSession(mSessionName)
.setConfigureIntent(mConfigureIntent)
.establish();