Merge "Fix USB tethering"
This commit is contained in:
committed by
Android (Google) Code Review
commit
865fcf3eb3
@@ -653,6 +653,17 @@ public class ConnectivityManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@hide}
|
||||
*/
|
||||
public int setUsbTethering(boolean enable) {
|
||||
try {
|
||||
return mService.setUsbTethering(enable);
|
||||
} catch (RemoteException e) {
|
||||
return TETHER_ERROR_SERVICE_UNAVAIL;
|
||||
}
|
||||
}
|
||||
|
||||
/** {@hide} */
|
||||
public static final int TETHER_ERROR_NO_ERROR = 0;
|
||||
/** {@hide} */
|
||||
|
||||
@@ -88,6 +88,8 @@ interface IConnectivityManager
|
||||
|
||||
String[] getTetherableBluetoothRegexs();
|
||||
|
||||
int setUsbTethering(boolean enable);
|
||||
|
||||
void requestNetworkTransitionWakelock(in String forWhom);
|
||||
|
||||
void reportInetCondition(int networkType, int percentage);
|
||||
|
||||
@@ -2262,6 +2262,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