Remove IpServer.Dependencies#getIfIndex.
This code is unused. Test: atest TetheringTests Change-Id: Iaac422d72e8538b67798cb3ae3737deb7b426401
This commit is contained in:
@@ -71,10 +71,8 @@ import com.android.networkstack.tethering.BpfCoordinator.ClientInfo;
|
||||
import com.android.networkstack.tethering.BpfCoordinator.Ipv6ForwardingRule;
|
||||
import com.android.networkstack.tethering.PrivateAddressCoordinator;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.Inet4Address;
|
||||
import java.net.Inet6Address;
|
||||
import java.net.NetworkInterface;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -187,16 +185,6 @@ public class IpServer extends StateMachine {
|
||||
return InterfaceParams.getByName(ifName);
|
||||
}
|
||||
|
||||
/** Get |ifName|'s interface index. */
|
||||
public int getIfindex(String ifName) {
|
||||
try {
|
||||
return NetworkInterface.getByName(ifName).getIndex();
|
||||
} catch (IOException | NullPointerException e) {
|
||||
Log.e(TAG, "Can't determine interface index for interface " + ifName);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/** Create a DhcpServer instance to be used by IpServer. */
|
||||
public abstract void makeDhcpServer(String ifName, DhcpServingParamsParcel params,
|
||||
DhcpServerCallbacks cb);
|
||||
|
||||
@@ -206,9 +206,6 @@ public class IpServerTest {
|
||||
when(mDependencies.getInterfaceParams(UPSTREAM_IFACE)).thenReturn(UPSTREAM_IFACE_PARAMS);
|
||||
when(mDependencies.getInterfaceParams(UPSTREAM_IFACE2)).thenReturn(UPSTREAM_IFACE_PARAMS2);
|
||||
|
||||
when(mDependencies.getIfindex(eq(UPSTREAM_IFACE))).thenReturn(UPSTREAM_IFINDEX);
|
||||
when(mDependencies.getIfindex(eq(UPSTREAM_IFACE2))).thenReturn(UPSTREAM_IFINDEX2);
|
||||
|
||||
mInterfaceConfiguration = new InterfaceConfigurationParcel();
|
||||
mInterfaceConfiguration.flags = new String[0];
|
||||
if (interfaceType == TETHERING_BLUETOOTH) {
|
||||
|
||||
Reference in New Issue
Block a user