Просмотр исходного кода

Remove unreliable seamlessVpnRestart function

See: https://github.com/Psiphon-Inc/psiphon-android/commit/66d4fcfcbcc5af488b3f3a0fb5212009c7997bec
Rod Hynes 4 лет назад
Родитель
Сommit
6569e04e57
1 измененных файлов с 0 добавлено и 31 удалено
  1. 0 31
      MobileLibrary/Android/PsiphonTunnel/PsiphonTunnel.java

+ 0 - 31
MobileLibrary/Android/PsiphonTunnel/PsiphonTunnel.java

@@ -285,37 +285,6 @@ public class PsiphonTunnel {
         Psi.reconnectTunnel();
     }
 
-    // Creates a temporary dummy VPN interface in order to prevent traffic leaking while performing
-    // complete VPN and tunnel restart, for example, caused by host app settings change.
-    // Note: same deadlock note as stop().
-    @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
-    public synchronized void seamlessVpnRestart(VpnService.Builder vpnServiceBuilder) throws Exception {
-        // Perform seamless VPN interface swap Psiphon VPN -> dummy VPN
-        //
-        // From https://developer.android.com/reference/android/net/VpnService.Builder.html#establish()
-        // "However, it is rare but not impossible to have two interfaces while performing a seamless handover.
-        // In this case, the old interface will be deactivated when the new one is created successfully. Both
-        // file descriptors are valid but now outgoing packets will be routed to the new interface. Therefore,
-        // after draining the old file descriptor, the application MUST close it and start using the new file
-        // descriptor."
-        ParcelFileDescriptor dummyVpnFd = startDummyVpn(vpnServiceBuilder);
-        try {
-            // Clean up and restart Psiphon VPN interface, which will also do the swap dummy VPN -> Psiphon VPN
-            stopVpn();
-            startVpn();
-        } finally {
-            // Close dummy VPN file descriptor as per documentation.
-            if (dummyVpnFd != null) {
-                try {
-                    dummyVpnFd.close();
-                } catch (IOException e) {
-                }
-            }
-        }
-        // Restart the tunnel.
-        restartPsiphon();
-    }
-
     public void setClientPlatformAffixes(String prefix, String suffix) {
         mClientPlatformPrefix.set(prefix);
         mClientPlatformSuffix.set(suffix);