DO NOT MERGE refactor wifi p2p's startDhcpServer function

Add getTetheredDhcpRanges() interface and call it before calling
mNwService.startTethering() to update dhcp ranges. This will allow p2p app
to run well concurrently with other tethering app(e.g. usb tethering).

Change-Id: I5e8ffeb5d2d396f48b897cd9396f133e25ecca57
Signed-off-by: Jianzheng Zhou <jianzheng.zhou@freescale.com>
This commit is contained in:
Jianzheng Zhou
2014-02-08 12:43:07 +08:00
committed by Robert Greenwalt
parent 582d33aa84
commit cb5b2c0716
3 changed files with 24 additions and 0 deletions

View File

@@ -928,6 +928,23 @@ public class ConnectivityManager {
}
}
/**
* Get the set of tethered dhcp ranges.
*
* @return an array of 0 or more Strings of tethered dhcp ranges.
*
* <p>This method requires the call to hold the permission
* {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
* {@hide}
*/
public String[] getTetheredDhcpRanges() {
try {
return mService.getTetheredDhcpRanges();
} catch (RemoteException e) {
return new String[0];
}
}
/**
* Get the set of tethered interfaces.
*

View File

@@ -91,6 +91,8 @@ interface IConnectivityManager
String[] getTetherableIfaces();
String[] getTetheredDhcpRanges();
String[] getTetheredIfaces();
String[] getTetheringErroredIfaces();

View File

@@ -3297,6 +3297,11 @@ public class ConnectivityService extends IConnectivityManager.Stub {
return mTethering.getTetherableIfaces();
}
public String[] getTetheredDhcpRanges() {
enforceConnectivityInternalPermission();
return mTethering.getTetheredDhcpRanges();
}
public String[] getTetheredIfaces() {
enforceTetherAccessPermission();
return mTethering.getTetheredIfaces();