Add error reporting for Tethering.
Also make the usb interface configuration more robust so retries are possible. Makes all Tethering errors recoverable - no harm letting them try again anyway. Worst case is they need to reboot.
This commit is contained in:
@@ -1457,15 +1457,36 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
||||
}
|
||||
|
||||
// javadoc from interface
|
||||
public boolean tether(String iface) {
|
||||
public int tether(String iface) {
|
||||
enforceTetherChangePermission();
|
||||
return isTetheringSupported() && mTethering.tether(iface);
|
||||
|
||||
if (isTetheringSupported()) {
|
||||
return mTethering.tether(iface);
|
||||
} else {
|
||||
return ConnectivityManager.TETHER_ERROR_UNSUPPORTED;
|
||||
}
|
||||
}
|
||||
|
||||
// javadoc from interface
|
||||
public boolean untether(String iface) {
|
||||
public int untether(String iface) {
|
||||
enforceTetherChangePermission();
|
||||
return isTetheringSupported() && mTethering.untether(iface);
|
||||
|
||||
if (isTetheringSupported()) {
|
||||
return mTethering.untether(iface);
|
||||
} else {
|
||||
return ConnectivityManager.TETHER_ERROR_UNSUPPORTED;
|
||||
}
|
||||
}
|
||||
|
||||
// javadoc from interface
|
||||
public int getLastTetherError(String iface) {
|
||||
enforceTetherAccessPermission();
|
||||
|
||||
if (isTetheringSupported()) {
|
||||
return mTethering.getLastTetherError(iface);
|
||||
} else {
|
||||
return ConnectivityManager.TETHER_ERROR_UNSUPPORTED;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO - proper iface API for selection by property, inspection, etc
|
||||
@@ -1499,6 +1520,11 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
||||
return mTethering.getTetheredIfaces();
|
||||
}
|
||||
|
||||
public String[] getTetheringErroredIfaces() {
|
||||
enforceTetherAccessPermission();
|
||||
return mTethering.getErroredIfaces();
|
||||
}
|
||||
|
||||
// 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.
|
||||
|
||||
Reference in New Issue
Block a user