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:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user