Merge "Support enable/disable dns forwarding of dnsmasq when start tethering"

This commit is contained in:
Luke Huang
2019-08-28 12:53:16 +00:00
committed by Gerrit Code Review
4 changed files with 16 additions and 4 deletions

View File

@@ -149,6 +149,14 @@ interface INetworkManagementService
@UnsupportedAppUsage
void startTethering(in String[] dhcpRanges);
/**
* Start tethering services with the specified dhcp server range and
* DNS proxy config.
* {@code boolean} is used to control legacy DNS proxy server.
* {@code String[]} is a set of start end pairs defining the ranges.
*/
void startTetheringWithConfiguration(boolean usingLegacyDnsProxy, in String[] dhcpRanges);
/**
* Stop currently running tethering services
*/

View File

@@ -51,7 +51,7 @@ java_library_static {
"android.hardware.contexthub-V1.0-java",
"android.hidl.manager-V1.2-java",
"dnsresolver_aidl_interface-V2-java",
"netd_aidl_interface-V2-java",
"netd_aidl_interface-java",
"netd_event_listener_interface-java",
],
}

View File

@@ -1003,11 +1003,15 @@ public class NetworkManagementService extends INetworkManagementService.Stub {
@Override
public void startTethering(String[] dhcpRange) {
startTetheringWithConfiguration(true, dhcpRange);
}
@Override
public void startTetheringWithConfiguration(boolean usingLegacyDnsProxy, String[] dhcpRange) {
mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG);
// an odd number of addrs will fail
try {
mNetdService.tetherStart(dhcpRange);
mNetdService.tetherStartWithConfiguration(usingLegacyDnsProxy, dhcpRange);
} catch (RemoteException | ServiceSpecificException e) {
throw new IllegalStateException(e);
}

View File

@@ -67,7 +67,7 @@ java_library_static {
static_libs: [
"dnsresolver_aidl_interface-V2-java",
"ipmemorystore-client",
"netd_aidl_interface-V2-java",
"netd_aidl_interface-java",
"networkstack-aidl-interfaces-V3-java",
],
}