diff --git a/core/java/android/net/EthernetManager.java b/core/java/android/net/EthernetManager.java index f45737a66e..664b7b4089 100644 --- a/core/java/android/net/EthernetManager.java +++ b/core/java/android/net/EthernetManager.java @@ -87,8 +87,8 @@ public class EthernetManager { public IpConfiguration getConfiguration() { try { return mService.getConfiguration(); - } catch (NullPointerException | RemoteException e) { - return new IpConfiguration(); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); } } @@ -98,7 +98,8 @@ public class EthernetManager { public void setConfiguration(IpConfiguration config) { try { mService.setConfiguration(config); - } catch (NullPointerException | RemoteException e) { + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); } } @@ -109,8 +110,8 @@ public class EthernetManager { public boolean isAvailable() { try { return mService.isAvailable(); - } catch (NullPointerException | RemoteException e) { - return false; + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); } } @@ -127,7 +128,8 @@ public class EthernetManager { if (mListeners.size() == 1) { try { mService.addListener(mServiceListener); - } catch (NullPointerException | RemoteException e) { + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); } } } @@ -145,7 +147,8 @@ public class EthernetManager { if (mListeners.isEmpty()) { try { mService.removeListener(mServiceListener); - } catch (NullPointerException | RemoteException e) { + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); } } } diff --git a/core/java/android/net/nsd/NsdManager.java b/core/java/android/net/nsd/NsdManager.java index 377ed88997..86bd502826 100644 --- a/core/java/android/net/nsd/NsdManager.java +++ b/core/java/android/net/nsd/NsdManager.java @@ -619,7 +619,9 @@ public final class NsdManager { public void setEnabled(boolean enabled) { try { mService.setEnabled(enabled); - } catch (RemoteException e) { } + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } } /** @@ -632,7 +634,7 @@ public final class NsdManager { try { return mService.getMessenger(); } catch (RemoteException e) { - return null; + throw e.rethrowFromSystemServer(); } } }