Update Framework to support multiple dhpc ranges
Previously we only supported a single range - this was inadequate for multiple interfaces. Adding a second range so we can support both usb and wifi tethering. Also moving out of the zero-conf range as our dhcp client won't accept ip addrs in that range (no nexus to nexus wifi action). bug: 2537963 bug: 2533491 bug: 2538303 Change-Id: I600b421343c28c2f9839ed2076122ae3d0ff5d3d
This commit is contained in:
@@ -312,11 +312,17 @@ class NetworkManagementService extends INetworkManagementService.Stub {
|
||||
mConnector.doCommand(String.format("ipfwd %sable", (enable ? "en" : "dis")));
|
||||
}
|
||||
|
||||
public void startTethering(String dhcpRangeStart, String dhcpRangeEnd)
|
||||
public void startTethering(String[] dhcpRange)
|
||||
throws IllegalStateException {
|
||||
mContext.enforceCallingOrSelfPermission(
|
||||
android.Manifest.permission.CHANGE_NETWORK_STATE, "NetworkManagementService");
|
||||
mConnector.doCommand(String.format("tether start %s %s", dhcpRangeStart, dhcpRangeEnd));
|
||||
// cmd is "tether start first_start first_stop second_start second_stop ..."
|
||||
// an odd number of addrs will fail
|
||||
String cmd = "tether start";
|
||||
for (String d : dhcpRange) {
|
||||
cmd += " " + d;
|
||||
}
|
||||
mConnector.doCommand(cmd);
|
||||
}
|
||||
|
||||
public void stopTethering() throws IllegalStateException {
|
||||
|
||||
Reference in New Issue
Block a user