Loading core/java/android/net/IpSecManager.java +5 −30 Original line number Diff line number Diff line Loading @@ -313,9 +313,7 @@ public final class IpSecManager { public void applyTransportModeTransform( Socket socket, int direction, IpSecTransform transform) throws IOException { try (ParcelFileDescriptor pfd = ParcelFileDescriptor.fromSocket(socket)) { applyTransportModeTransform(pfd, direction, transform); } applyTransportModeTransform(socket.getFileDescriptor$(), direction, transform); } /** Loading Loading @@ -347,9 +345,7 @@ public final class IpSecManager { */ public void applyTransportModeTransform( DatagramSocket socket, int direction, IpSecTransform transform) throws IOException { try (ParcelFileDescriptor pfd = ParcelFileDescriptor.fromDatagramSocket(socket)) { applyTransportModeTransform(pfd, direction, transform); } applyTransportModeTransform(socket.getFileDescriptor$(), direction, transform); } /** Loading Loading @@ -383,18 +379,8 @@ public final class IpSecManager { FileDescriptor socket, int direction, IpSecTransform transform) throws IOException { // We dup() the FileDescriptor here because if we don't, then the ParcelFileDescriptor() // constructor takes control and closes the user's FD when we exit the method // This is behaviorally the same as the other versions, but the PFD constructor does not // dup() automatically, whereas PFD.fromSocket() and PDF.fromDatagramSocket() do dup(). // constructor takes control and closes the user's FD when we exit the method. try (ParcelFileDescriptor pfd = ParcelFileDescriptor.dup(socket)) { applyTransportModeTransform(pfd, direction, transform); } } /* Call down to activate a transform */ private void applyTransportModeTransform( ParcelFileDescriptor pfd, int direction, IpSecTransform transform) throws IOException { try { mService.applyTransportModeTransform(pfd, direction, transform.getResourceId()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); Loading Loading @@ -433,9 +419,7 @@ public final class IpSecManager { */ public void removeTransportModeTransforms(Socket socket, IpSecTransform transform) throws IOException { try (ParcelFileDescriptor pfd = ParcelFileDescriptor.fromSocket(socket)) { removeTransportModeTransforms(pfd, transform); } removeTransportModeTransforms(socket.getFileDescriptor$(), transform); } /** Loading @@ -455,9 +439,7 @@ public final class IpSecManager { */ public void removeTransportModeTransforms(DatagramSocket socket, IpSecTransform transform) throws IOException { try (ParcelFileDescriptor pfd = ParcelFileDescriptor.fromDatagramSocket(socket)) { removeTransportModeTransforms(pfd, transform); } removeTransportModeTransforms(socket.getFileDescriptor$(), transform); } /** Loading @@ -478,13 +460,6 @@ public final class IpSecManager { public void removeTransportModeTransforms(FileDescriptor socket, IpSecTransform transform) throws IOException { try (ParcelFileDescriptor pfd = ParcelFileDescriptor.dup(socket)) { removeTransportModeTransforms(pfd, transform); } } /* Call down to remove a transform */ private void removeTransportModeTransforms(ParcelFileDescriptor pfd, IpSecTransform transform) { try { mService.removeTransportModeTransforms(pfd, transform.getResourceId()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); Loading Loading
core/java/android/net/IpSecManager.java +5 −30 Original line number Diff line number Diff line Loading @@ -313,9 +313,7 @@ public final class IpSecManager { public void applyTransportModeTransform( Socket socket, int direction, IpSecTransform transform) throws IOException { try (ParcelFileDescriptor pfd = ParcelFileDescriptor.fromSocket(socket)) { applyTransportModeTransform(pfd, direction, transform); } applyTransportModeTransform(socket.getFileDescriptor$(), direction, transform); } /** Loading Loading @@ -347,9 +345,7 @@ public final class IpSecManager { */ public void applyTransportModeTransform( DatagramSocket socket, int direction, IpSecTransform transform) throws IOException { try (ParcelFileDescriptor pfd = ParcelFileDescriptor.fromDatagramSocket(socket)) { applyTransportModeTransform(pfd, direction, transform); } applyTransportModeTransform(socket.getFileDescriptor$(), direction, transform); } /** Loading Loading @@ -383,18 +379,8 @@ public final class IpSecManager { FileDescriptor socket, int direction, IpSecTransform transform) throws IOException { // We dup() the FileDescriptor here because if we don't, then the ParcelFileDescriptor() // constructor takes control and closes the user's FD when we exit the method // This is behaviorally the same as the other versions, but the PFD constructor does not // dup() automatically, whereas PFD.fromSocket() and PDF.fromDatagramSocket() do dup(). // constructor takes control and closes the user's FD when we exit the method. try (ParcelFileDescriptor pfd = ParcelFileDescriptor.dup(socket)) { applyTransportModeTransform(pfd, direction, transform); } } /* Call down to activate a transform */ private void applyTransportModeTransform( ParcelFileDescriptor pfd, int direction, IpSecTransform transform) throws IOException { try { mService.applyTransportModeTransform(pfd, direction, transform.getResourceId()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); Loading Loading @@ -433,9 +419,7 @@ public final class IpSecManager { */ public void removeTransportModeTransforms(Socket socket, IpSecTransform transform) throws IOException { try (ParcelFileDescriptor pfd = ParcelFileDescriptor.fromSocket(socket)) { removeTransportModeTransforms(pfd, transform); } removeTransportModeTransforms(socket.getFileDescriptor$(), transform); } /** Loading @@ -455,9 +439,7 @@ public final class IpSecManager { */ public void removeTransportModeTransforms(DatagramSocket socket, IpSecTransform transform) throws IOException { try (ParcelFileDescriptor pfd = ParcelFileDescriptor.fromDatagramSocket(socket)) { removeTransportModeTransforms(pfd, transform); } removeTransportModeTransforms(socket.getFileDescriptor$(), transform); } /** Loading @@ -478,13 +460,6 @@ public final class IpSecManager { public void removeTransportModeTransforms(FileDescriptor socket, IpSecTransform transform) throws IOException { try (ParcelFileDescriptor pfd = ParcelFileDescriptor.dup(socket)) { removeTransportModeTransforms(pfd, transform); } } /* Call down to remove a transform */ private void removeTransportModeTransforms(ParcelFileDescriptor pfd, IpSecTransform transform) { try { mService.removeTransportModeTransforms(pfd, transform.getResourceId()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); Loading