Catch RuntimeException in NMService notifications

Currently, NetworkManagementService only catches RemoteExceptions
when calling the BaseNetworkObserver notification methods (e.g.,
interfaceStatusChanged). However, if the observer is in the same
process, unchecked exceptions can occur as well.

When this happens, finishBroadcast does not get called, and no
further notifications can be sent, because any attempt to do so
fails with a "beginBroadcast() called while already in a
broadcast" exception.

Fix this by catching RuntimeException as well.

Bug: 8397534
Bug: 8276725
Change-Id: Icd6f32128707244978943c48a9ea3a2b952a2957
diff --git a/services/java/com/android/server/NetworkManagementService.java b/services/java/com/android/server/NetworkManagementService.java
index 7686705..2210a18 100644
--- a/services/java/com/android/server/NetworkManagementService.java
+++ b/services/java/com/android/server/NetworkManagementService.java
@@ -233,6 +233,7 @@
             try {
                 mObservers.getBroadcastItem(i).interfaceStatusChanged(iface, up);
             } catch (RemoteException e) {
+            } catch (RuntimeException e) {
             }
         }
         mObservers.finishBroadcast();
@@ -248,6 +249,7 @@
             try {
                 mObservers.getBroadcastItem(i).interfaceLinkStateChanged(iface, up);
             } catch (RemoteException e) {
+            } catch (RuntimeException e) {
             }
         }
         mObservers.finishBroadcast();
@@ -262,6 +264,7 @@
             try {
                 mObservers.getBroadcastItem(i).interfaceAdded(iface);
             } catch (RemoteException e) {
+            } catch (RuntimeException e) {
             }
         }
         mObservers.finishBroadcast();
@@ -281,6 +284,7 @@
             try {
                 mObservers.getBroadcastItem(i).interfaceRemoved(iface);
             } catch (RemoteException e) {
+            } catch (RuntimeException e) {
             }
         }
         mObservers.finishBroadcast();
@@ -295,6 +299,7 @@
             try {
                 mObservers.getBroadcastItem(i).limitReached(limitName, iface);
             } catch (RemoteException e) {
+            } catch (RuntimeException e) {
             }
         }
         mObservers.finishBroadcast();
@@ -309,6 +314,7 @@
             try {
                 mObservers.getBroadcastItem(i).interfaceClassDataActivityChanged(label, active);
             } catch (RemoteException e) {
+            } catch (RuntimeException e) {
             }
         }
         mObservers.finishBroadcast();