Fix USB tethering

The previous approach no longer works with the new USB drivers, since the usb0
interface is no longer enabled by default.
This introduced a chicken & egg problem - usb0 will not be enabled until the
user tries to start tethering, but Settings will not enable the checkbox unless
usb0 is enabled.
To fix this we add an explicit call to start USB tethering in the connectivity manager.
This will enable RNDIS if necessary and then bring up tethering once usb0 is enabled.

Change-Id: Iae1f733366aa6b0dafa66d4c97207794173ef54b
Signed-off-by: Mike Lockwood <lockwood@android.com>
This commit is contained in:
Mike Lockwood
2011-07-19 13:04:47 -07:00
parent dee9654b9d
commit ed4a1741b4
3 changed files with 22 additions and 0 deletions

View File

@@ -2236,6 +2236,15 @@ public class ConnectivityService extends IConnectivityManager.Stub {
}
}
public int setUsbTethering(boolean enable) {
enforceTetherAccessPermission();
if (isTetheringSupported()) {
return mTethering.setUsbTethering(enable);
} else {
return ConnectivityManager.TETHER_ERROR_UNSUPPORTED;
}
}
// TODO - move iface listing, queries, etc to new module
// javadoc from interface
public String[] getTetherableIfaces() {