Loading core/java/android/net/ConnectivityManager.java +14 −0 Original line number Diff line number Diff line Loading @@ -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 Loading core/java/android/net/IConnectivityManager.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -93,6 +93,8 @@ interface IConnectivityManager String[] getTetheringErroredIfaces(); String[] getTetheredDhcpRanges(); String[] getTetherableUsbRegexs(); String[] getTetherableWifiRegexs(); Loading services/core/java/com/android/server/ConnectivityService.java +5 −0 Original line number Diff line number Diff line Loading @@ -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. Loading services/core/java/com/android/server/connectivity/Tethering.java +6 −1 Original line number Diff line number Diff line Loading @@ -109,13 +109,14 @@ public class Tethering extends BaseNetworkObserver { // Wifi is 192.168.43.1 and 255.255.255.0 // BT is limited to max default of 5 connections. 192.168.44.1 to 192.168.48.1 // with 255.255.255.0 // P2P is 192.168.49.1 and 255.255.255.0 private String[] mDhcpRange; private static final String[] DHCP_DEFAULT_RANGE = { "192.168.42.2", "192.168.42.254", "192.168.43.2", "192.168.43.254", "192.168.44.2", "192.168.44.254", "192.168.45.2", "192.168.45.254", "192.168.46.2", "192.168.46.254", "192.168.47.2", "192.168.47.254", "192.168.48.2", "192.168.48.254", "192.168.48.2", "192.168.48.254", "192.168.49.2", "192.168.49.254", }; private String[] mDefaultDnsServers; Loading Loading @@ -701,6 +702,10 @@ public class Tethering extends BaseNetworkObserver { return retVal; } public String[] getTetheredDhcpRanges() { return mDhcpRange; } public String[] getErroredIfaces() { ArrayList<String> list = new ArrayList<String>(); synchronized (mPublicSync) { Loading Loading
core/java/android/net/ConnectivityManager.java +14 −0 Original line number Diff line number Diff line Loading @@ -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 Loading
core/java/android/net/IConnectivityManager.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -93,6 +93,8 @@ interface IConnectivityManager String[] getTetheringErroredIfaces(); String[] getTetheredDhcpRanges(); String[] getTetherableUsbRegexs(); String[] getTetherableWifiRegexs(); Loading
services/core/java/com/android/server/ConnectivityService.java +5 −0 Original line number Diff line number Diff line Loading @@ -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. Loading
services/core/java/com/android/server/connectivity/Tethering.java +6 −1 Original line number Diff line number Diff line Loading @@ -109,13 +109,14 @@ public class Tethering extends BaseNetworkObserver { // Wifi is 192.168.43.1 and 255.255.255.0 // BT is limited to max default of 5 connections. 192.168.44.1 to 192.168.48.1 // with 255.255.255.0 // P2P is 192.168.49.1 and 255.255.255.0 private String[] mDhcpRange; private static final String[] DHCP_DEFAULT_RANGE = { "192.168.42.2", "192.168.42.254", "192.168.43.2", "192.168.43.254", "192.168.44.2", "192.168.44.254", "192.168.45.2", "192.168.45.254", "192.168.46.2", "192.168.46.254", "192.168.47.2", "192.168.47.254", "192.168.48.2", "192.168.48.254", "192.168.48.2", "192.168.48.254", "192.168.49.2", "192.168.49.254", }; private String[] mDefaultDnsServers; Loading Loading @@ -701,6 +702,10 @@ public class Tethering extends BaseNetworkObserver { return retVal; } public String[] getTetheredDhcpRanges() { return mDhcpRange; } public String[] getErroredIfaces() { ArrayList<String> list = new ArrayList<String>(); synchronized (mPublicSync) { Loading