Merge "Refactor wifi p2p's startDhcpServer function"

This commit is contained in:
Robert Greenwalt
2014-07-10 19:15:24 +00:00
committed by Android (Google) Code Review
3 changed files with 21 additions and 0 deletions

View File

@@ -1499,6 +1499,20 @@ public class ConnectivityManager {
}
}
/**
* Get the set of tethered dhcp ranges.
*
* @return an array of 0 or more {@code String} of tethered dhcp ranges.
* {@hide}
*/
public String[] getTetheredDhcpRanges() {
try {
return mService.getTetheredDhcpRanges();
} catch (RemoteException e) {
return new String[0];
}
}
/**
* Attempt to tether the named interface. This will setup a dhcp server
* on the interface, forward and NAT IP packets and forward DNS requests

View File

@@ -93,6 +93,8 @@ interface IConnectivityManager
String[] getTetheringErroredIfaces();
String[] getTetheredDhcpRanges();
String[] getTetherableUsbRegexs();
String[] getTetherableWifiRegexs();

View File

@@ -3684,6 +3684,11 @@ public class ConnectivityService extends IConnectivityManager.Stub {
return mTethering.getErroredIfaces();
}
public String[] getTetheredDhcpRanges() {
enforceConnectivityInternalPermission();
return mTethering.getTetheredDhcpRanges();
}
// if ro.tether.denied = true we default to no tethering
// gservices could set the secure setting to 1 though to enable it on a build where it
// had previously been turned off.