Don't crash if the interface disappears just after appearing. am: 17f4e4a027 am: b131ddc5fd am: 0f5a6a6bd2
am: c44ff6cd15

Change-Id: I832ce1a318425617aed7f684bf2d5ed8905b8960
diff --git a/service-t/src/com/android/server/ethernet/EthernetNetworkFactory.java b/service-t/src/com/android/server/ethernet/EthernetNetworkFactory.java
index 7ff3f6c..d6d0def 100644
--- a/service-t/src/com/android/server/ethernet/EthernetNetworkFactory.java
+++ b/service-t/src/com/android/server/ethernet/EthernetNetworkFactory.java
@@ -208,7 +208,7 @@
             InterfaceConfiguration config = mNMService.getInterfaceConfig(iface);
 
             if (config == null) {
-                Log.e(TAG, "Null iterface config for " + iface + ". Bailing out.");
+                Log.e(TAG, "Null interface config for " + iface + ". Bailing out.");
                 return;
             }
 
@@ -220,7 +220,9 @@
                 Log.e(TAG, "Interface unexpectedly changed from " + iface + " to " + mIface);
                 mNMService.setInterfaceDown(iface);
             }
-        } catch (RemoteException e) {
+        } catch (RemoteException | IllegalStateException e) {
+            // Either the system is crashing or the interface has disappeared. Just ignore the
+            // error; we haven't modified any state because we only do that if our calls succeed.
             Log.e(TAG, "Error upping interface " + mIface + ": " + e);
         }
     }