Better error handling when NetworkManagementService#untetherInterface() fails.
Additionally, catch ServiceSpecificException when making netd binder calls.
Test:
Flipped back and forth between USB and wifi tethering and no longer
some of the unrecoverable errors.
Bug: 30882741
Change-Id: I470b7cfdaaa82013db35b500a5df10dcfaad2d8c
diff --git a/services/core/java/com/android/server/NetworkManagementService.java b/services/core/java/com/android/server/NetworkManagementService.java
index ec53c16..bdbd066 100644
--- a/services/core/java/com/android/server/NetworkManagementService.java
+++ b/services/core/java/com/android/server/NetworkManagementService.java
@@ -1310,8 +1310,9 @@
mConnector.execute("tether", "interface", "remove", iface);
} catch (NativeDaemonConnectorException e) {
throw e.rethrowAsParcelableException();
+ } finally {
+ removeInterfaceFromLocalNetwork(iface);
}
- removeInterfaceFromLocalNetwork(iface);
}
@Override