diff options
| author | Robert Greenwalt <robdroid@android.com> | 2010-03-02 17:25:02 -0800 |
|---|---|---|
| committer | Robert Greenwalt <robdroid@android.com> | 2010-03-03 15:14:29 -0800 |
| commit | 5a73506cdd466f2b96686ced3ff0f7ca224d1143 (patch) | |
| tree | 9818d6ef9b3f3dd9658d9ea7eb6ccb9de65d38f5 /services/java/com/android/server/ConnectivityService.java | |
| parent | 9b10ef5fe85e9d29721ff0cd15161f960d38a8db (diff) | |
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.
Diffstat (limited to 'services/java/com/android/server/ConnectivityService.java')
| -rw-r--r-- | services/java/com/android/server/ConnectivityService.java | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java index 67b6200dc944..a1c45dce8204 100644 --- a/services/java/com/android/server/ConnectivityService.java +++ b/services/java/com/android/server/ConnectivityService.java @@ -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. |
