Source:
<code>public void addTransportModeTransform(IpSecConfig config) { long idToken = Binder.clearCallingIdentity(); <START> int featureMask = IpSecConfig.FEATURE_TRANSPORT_MODE | IpSecConfig.FEATURE_SELECTOR; <END> if(!config.hasFeature(featureMask)) { throw new IllegalArgumentException("Missing Transport Mode Config"); } if(!config.hasFeature(IpSecConfig.FEATURE_ENCRYPTION) && !config.hasFeature(IpSecConfig.FEATURE_AUTHENTICATION)) { throw new IllegalArgumentException("No Encryption or Authentication Provided"); } if(!config.hasFeature(IpSecConfig.FEATURE_NETWORK)) { throw new IllegalArgumentException("Transform must be applied to a specific network"); } ParcelFileDescriptor localSocket = config.getLocalSocket(); int remotePort = config.getRemotePort(); String remoteIp = config.getRemoteIp().getHostAddress(); int spi = config.getSpi(); int direction = config.getDirection(); IpSecAlgorithm auth = null; String authAlgo = null; byte[] authKey = null; int authTruncBits = 0; auth = config.getAuthenticationAlgo(); if(auth != null) { authAlgo = auth.getAlgorithm(); authKey = auth.getKey(); authTruncBits = auth.getTruncLenBits(); } IpSecAlgorithm crypt = null; String cryptAlgo = null; byte[] cryptKey = null; int cryptTruncBits = 0; crypt = config.getEncryptionAlgo(); if(crypt != null) { cryptAlgo = crypt.getAlgorithm(); cryptKey = crypt.getKey(); cryptTruncBits = crypt.getTruncLenBits(); } Network net = config.getNetwork(); long netHandle = 0; if(net != null) { netHandle = net.getNetworkHandle(); } Binder.restoreCallingIdentity(idToken); try { mNetdService.addTransportModeTransform( localSocket.getFileDescriptor(), remoteIp, remotePort, spi, direction, authAlgo, authKey, authTruncBits, cryptAlgo, cryptKey, cryptTruncBits, netHandle, Binder.getCallingUid()); } catch (RemoteException e) { throw new RuntimeException(e); } }</code><technical_language>Consider making this a static final int constant class level</technical_language>

Target:
public void addTransportModeTransform(IpSecConfig config) { long idToken = Binder.clearCallingIdentity(); int featureMask = IpSecConfig.FEATURE_TRANSPORT_MODE | IpSecConfig.FEATURE_SELECTOR; if (!config.hasFeature(featureMask)) { throw new IllegalArgumentException("Missing Transport Mode Config"); } if (!config.hasFeature(IpSecConfig.FEATURE_ENCRYPTION) && !config.hasFeature(IpSecConfig.FEATURE_AUTHENTICATION)) { throw new IllegalArgumentException("No Encryption or Authentication Provided"); } if (!config.hasFeature(IpSecConfig.FEATURE_NETWORK)) { throw new IllegalArgumentException("Transform must be applied to a specific network"); } ParcelFileDescriptor localSocket = config.getLocalSocket(); int remotePort = config.getRemotePort(); String remoteIp = config.getRemoteIp().getHostAddress(); int spi = config.getSpi(); int direction = config.getDirection(); IpSecAlgorithm auth = null; String authAlgo = null; byte[] authKey = null; int authTruncBits = 0; auth = config.getAuthenticationAlgo(); if (auth != null) { authAlgo = auth.getAlgorithm(); authKey = auth.getKey(); authTruncBits = auth.getTruncLenBits(); } IpSecAlgorithm crypt = null; String cryptAlgo = null; byte[] cryptKey = null; int cryptTruncBits = 0; crypt = config.getEncryptionAlgo(); if (crypt != null) { cryptAlgo = crypt.getAlgorithm(); cryptKey = crypt.getKey(); cryptTruncBits = crypt.getTruncLenBits(); } Network net = config.getNetwork(); long netHandle = 0; if (net != null) { netHandle = net.getNetworkHandle(); } Binder.restoreCallingIdentity(idToken); try { mNetdService.addTransportModeTransform( localSocket.getFileDescriptor(), remoteIp, remotePort, spi, direction, authAlgo, authKey, authTruncBits, cryptAlgo, cryptKey, cryptTruncBits, netHandle, Binder.getCallingUid()); } catch (RemoteException e) { Log.e(TAG, "Could not call netDNativeService!: " + e); throw new RuntimeException(e); } }