Don't crash if the interface disappears just after appearing. am: 17f4e4a027
am: b131ddc5fd
Change-Id: Ib35b0a5c3e7bcd44c8033ae53ce0fbb5c7d86bec
This commit is contained in:
@@ -208,7 +208,7 @@ class EthernetNetworkFactory {
|
|||||||
InterfaceConfiguration config = mNMService.getInterfaceConfig(iface);
|
InterfaceConfiguration config = mNMService.getInterfaceConfig(iface);
|
||||||
|
|
||||||
if (config == null) {
|
if (config == null) {
|
||||||
Log.e(TAG, "Null iterface config for " + iface + ". Bailing out.");
|
Log.e(TAG, "Null interface config for " + iface + ". Bailing out.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -220,7 +220,9 @@ class EthernetNetworkFactory {
|
|||||||
Log.e(TAG, "Interface unexpectedly changed from " + iface + " to " + mIface);
|
Log.e(TAG, "Interface unexpectedly changed from " + iface + " to " + mIface);
|
||||||
mNMService.setInterfaceDown(iface);
|
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);
|
Log.e(TAG, "Error upping interface " + mIface + ": " + e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user