Skip to content

Commit

Permalink
Tethering: TETHERING_WIGIG fixes
Browse files Browse the repository at this point in the history
1. enableWifiIpServingLocked uses hard-coded TETHERING_WIFI. This
doesn't work well with SoftAP on Wigig interface (wigig0). Use correct
interface type instead.

2. In IpServer treat Wigig same as Wifi by ignoring interface up/down
commands.

Change-Id: I19610bd5abcca2d8e6c225472b2cfc351ad6b341
CRs-Fixed: 2542959
  • Loading branch information
Dedy Lansky committed Oct 15, 2019
1 parent d8a16b1 commit f90d6cc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,12 @@ private void enableWifiIpServingLocked(String ifname, int wifiIpMode) {
}

if (!TextUtils.isEmpty(ifname)) {
maybeTrackNewInterfaceLocked(ifname, TETHERING_WIFI);
final int interfaceType = ifaceNameToType(ifname);
if (interfaceType == TETHERING_INVALID) {
mLog.log(ifname + " is not a tetherable iface, ignoring");
return;
}
maybeTrackNewInterfaceLocked(ifname, interfaceType);
changeInterfaceState(ifname, ipServingMode);
} else {
mLog.e(String.format(
Expand Down
3 changes: 2 additions & 1 deletion services/net/java/android/net/ip/IpServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,8 @@ private boolean configureIPv4(boolean enabled) {
InetAddress addr = numericToInetAddress(ipAsString);
linkAddr = new LinkAddress(addr, prefixLen);
ifcg.setLinkAddress(linkAddr);
if (mInterfaceType == ConnectivityManager.TETHERING_WIFI) {
if (mInterfaceType == ConnectivityManager.TETHERING_WIFI ||
mInterfaceType == ConnectivityManager.TETHERING_WIGIG) {
// The WiFi stack has ownership of the interface up/down state.
// It is unclear whether the Bluetooth or USB stacks will manage their own
// state.
Expand Down

0 comments on commit f90d6cc

Please sign in to comment.