diff options
author | Lorenzo Colitti <lorenzo@google.com> | 2017-06-23 05:02:47 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-06-23 05:02:47 +0000 |
commit | bd11f92d21d7838d414fa9e971ac8cfc5927bc17 (patch) | |
tree | 658a2f8a9f071a8154007b56291d2f6fe53b3f07 | |
parent | f43c7fbc0d3d7e6f56e9862fa6a7a1af0f4996d3 (diff) | |
parent | c31012bfc3f88b243f62cae3cb627041bcb20f2b (diff) | |
download | ethernet-bd11f92d21d7838d414fa9e971ac8cfc5927bc17.tar.gz |
Don't crash if the interface disappears just after appearing. am: 264bef96c8 am: e65566d619 am: 93a05c2104
am: c31012bfc3
Change-Id: I832ce1a318425617aed7f684bf2d5ed8905b8960
-rw-r--r-- | java/com/android/server/ethernet/EthernetNetworkFactory.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/java/com/android/server/ethernet/EthernetNetworkFactory.java b/java/com/android/server/ethernet/EthernetNetworkFactory.java index 7ff3f6c..d6d0def 100644 --- a/java/com/android/server/ethernet/EthernetNetworkFactory.java +++ b/java/com/android/server/ethernet/EthernetNetworkFactory.java @@ -208,7 +208,7 @@ class EthernetNetworkFactory { 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 @@ class EthernetNetworkFactory { 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); } } |