Loading packages/ConnectivityT/framework-t/src/android/net/IpSecManager.java +2 −3 Original line number Diff line number Diff line Loading @@ -17,8 +17,6 @@ package android.net; import static android.annotation.SystemApi.Client.MODULE_LIBRARIES; import static com.android.internal.util.Preconditions.checkNotNull; import android.annotation.NonNull; import android.annotation.RequiresFeature; import android.annotation.RequiresPermission; Loading Loading @@ -46,6 +44,7 @@ import java.io.IOException; import java.net.DatagramSocket; import java.net.InetAddress; import java.net.Socket; import java.util.Objects; /** * This class contains methods for managing IPsec sessions. Once configured, the kernel will apply Loading Loading @@ -989,7 +988,7 @@ public final class IpSecManager { */ public IpSecManager(Context ctx, IIpSecService service) { mContext = ctx; mService = checkNotNull(service, "missing service"); mService = Objects.requireNonNull(service, "missing service"); } private static void maybeHandleServiceSpecificException(ServiceSpecificException sse) { Loading packages/ConnectivityT/framework-t/src/android/net/IpSecTransform.java +10 −10 Original line number Diff line number Diff line Loading @@ -33,7 +33,6 @@ import android.os.ServiceSpecificException; import android.util.Log; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.util.Preconditions; import dalvik.system.CloseGuard; Loading @@ -41,6 +40,7 @@ import java.io.IOException; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.net.InetAddress; import java.util.Objects; /** * This class represents a transform, which roughly corresponds to an IPsec Security Association. Loading Loading @@ -255,7 +255,7 @@ public final class IpSecTransform implements AutoCloseable { @NonNull public IpSecTransform.Builder setEncryption(@NonNull IpSecAlgorithm algo) { // TODO: throw IllegalArgumentException if algo is not an encryption algorithm. Preconditions.checkNotNull(algo); Objects.requireNonNull(algo); mConfig.setEncryption(algo); return this; } Loading @@ -270,7 +270,7 @@ public final class IpSecTransform implements AutoCloseable { @NonNull public IpSecTransform.Builder setAuthentication(@NonNull IpSecAlgorithm algo) { // TODO: throw IllegalArgumentException if algo is not an authentication algorithm. Preconditions.checkNotNull(algo); Objects.requireNonNull(algo); mConfig.setAuthentication(algo); return this; } Loading @@ -290,7 +290,7 @@ public final class IpSecTransform implements AutoCloseable { */ @NonNull public IpSecTransform.Builder setAuthenticatedEncryption(@NonNull IpSecAlgorithm algo) { Preconditions.checkNotNull(algo); Objects.requireNonNull(algo); mConfig.setAuthenticatedEncryption(algo); return this; } Loading @@ -311,7 +311,7 @@ public final class IpSecTransform implements AutoCloseable { @NonNull public IpSecTransform.Builder setIpv4Encapsulation( @NonNull IpSecManager.UdpEncapsulationSocket localSocket, int remotePort) { Preconditions.checkNotNull(localSocket); Objects.requireNonNull(localSocket); mConfig.setEncapType(ENCAP_ESPINUDP); if (localSocket.getResourceId() == INVALID_RESOURCE_ID) { throw new IllegalArgumentException("Invalid UdpEncapsulationSocket"); Loading Loading @@ -348,8 +348,8 @@ public final class IpSecTransform implements AutoCloseable { @NonNull IpSecManager.SecurityParameterIndex spi) throws IpSecManager.ResourceUnavailableException, IpSecManager.SpiUnavailableException, IOException { Preconditions.checkNotNull(sourceAddress); Preconditions.checkNotNull(spi); Objects.requireNonNull(sourceAddress); Objects.requireNonNull(spi); if (spi.getResourceId() == INVALID_RESOURCE_ID) { throw new IllegalArgumentException("Invalid SecurityParameterIndex"); } Loading Loading @@ -387,8 +387,8 @@ public final class IpSecTransform implements AutoCloseable { @NonNull IpSecManager.SecurityParameterIndex spi) throws IpSecManager.ResourceUnavailableException, IpSecManager.SpiUnavailableException, IOException { Preconditions.checkNotNull(sourceAddress); Preconditions.checkNotNull(spi); Objects.requireNonNull(sourceAddress); Objects.requireNonNull(spi); if (spi.getResourceId() == INVALID_RESOURCE_ID) { throw new IllegalArgumentException("Invalid SecurityParameterIndex"); } Loading @@ -404,7 +404,7 @@ public final class IpSecTransform implements AutoCloseable { * @param context current context */ public Builder(@NonNull Context context) { Preconditions.checkNotNull(context); Objects.requireNonNull(context); mContext = context; mConfig = new IpSecConfig(); } Loading Loading
packages/ConnectivityT/framework-t/src/android/net/IpSecManager.java +2 −3 Original line number Diff line number Diff line Loading @@ -17,8 +17,6 @@ package android.net; import static android.annotation.SystemApi.Client.MODULE_LIBRARIES; import static com.android.internal.util.Preconditions.checkNotNull; import android.annotation.NonNull; import android.annotation.RequiresFeature; import android.annotation.RequiresPermission; Loading Loading @@ -46,6 +44,7 @@ import java.io.IOException; import java.net.DatagramSocket; import java.net.InetAddress; import java.net.Socket; import java.util.Objects; /** * This class contains methods for managing IPsec sessions. Once configured, the kernel will apply Loading Loading @@ -989,7 +988,7 @@ public final class IpSecManager { */ public IpSecManager(Context ctx, IIpSecService service) { mContext = ctx; mService = checkNotNull(service, "missing service"); mService = Objects.requireNonNull(service, "missing service"); } private static void maybeHandleServiceSpecificException(ServiceSpecificException sse) { Loading
packages/ConnectivityT/framework-t/src/android/net/IpSecTransform.java +10 −10 Original line number Diff line number Diff line Loading @@ -33,7 +33,6 @@ import android.os.ServiceSpecificException; import android.util.Log; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.util.Preconditions; import dalvik.system.CloseGuard; Loading @@ -41,6 +40,7 @@ import java.io.IOException; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.net.InetAddress; import java.util.Objects; /** * This class represents a transform, which roughly corresponds to an IPsec Security Association. Loading Loading @@ -255,7 +255,7 @@ public final class IpSecTransform implements AutoCloseable { @NonNull public IpSecTransform.Builder setEncryption(@NonNull IpSecAlgorithm algo) { // TODO: throw IllegalArgumentException if algo is not an encryption algorithm. Preconditions.checkNotNull(algo); Objects.requireNonNull(algo); mConfig.setEncryption(algo); return this; } Loading @@ -270,7 +270,7 @@ public final class IpSecTransform implements AutoCloseable { @NonNull public IpSecTransform.Builder setAuthentication(@NonNull IpSecAlgorithm algo) { // TODO: throw IllegalArgumentException if algo is not an authentication algorithm. Preconditions.checkNotNull(algo); Objects.requireNonNull(algo); mConfig.setAuthentication(algo); return this; } Loading @@ -290,7 +290,7 @@ public final class IpSecTransform implements AutoCloseable { */ @NonNull public IpSecTransform.Builder setAuthenticatedEncryption(@NonNull IpSecAlgorithm algo) { Preconditions.checkNotNull(algo); Objects.requireNonNull(algo); mConfig.setAuthenticatedEncryption(algo); return this; } Loading @@ -311,7 +311,7 @@ public final class IpSecTransform implements AutoCloseable { @NonNull public IpSecTransform.Builder setIpv4Encapsulation( @NonNull IpSecManager.UdpEncapsulationSocket localSocket, int remotePort) { Preconditions.checkNotNull(localSocket); Objects.requireNonNull(localSocket); mConfig.setEncapType(ENCAP_ESPINUDP); if (localSocket.getResourceId() == INVALID_RESOURCE_ID) { throw new IllegalArgumentException("Invalid UdpEncapsulationSocket"); Loading Loading @@ -348,8 +348,8 @@ public final class IpSecTransform implements AutoCloseable { @NonNull IpSecManager.SecurityParameterIndex spi) throws IpSecManager.ResourceUnavailableException, IpSecManager.SpiUnavailableException, IOException { Preconditions.checkNotNull(sourceAddress); Preconditions.checkNotNull(spi); Objects.requireNonNull(sourceAddress); Objects.requireNonNull(spi); if (spi.getResourceId() == INVALID_RESOURCE_ID) { throw new IllegalArgumentException("Invalid SecurityParameterIndex"); } Loading Loading @@ -387,8 +387,8 @@ public final class IpSecTransform implements AutoCloseable { @NonNull IpSecManager.SecurityParameterIndex spi) throws IpSecManager.ResourceUnavailableException, IpSecManager.SpiUnavailableException, IOException { Preconditions.checkNotNull(sourceAddress); Preconditions.checkNotNull(spi); Objects.requireNonNull(sourceAddress); Objects.requireNonNull(spi); if (spi.getResourceId() == INVALID_RESOURCE_ID) { throw new IllegalArgumentException("Invalid SecurityParameterIndex"); } Loading @@ -404,7 +404,7 @@ public final class IpSecTransform implements AutoCloseable { * @param context current context */ public Builder(@NonNull Context context) { Preconditions.checkNotNull(context); Objects.requireNonNull(context); mContext = context; mConfig = new IpSecConfig(); } Loading