Remove Parcelable interface from DefaultNetworkEvent

This patch takes advantage of the direct DefaultNetworkMetrics interface
between ConnectivityService and IpConnectivityMetrics and removes the
Parcelable interface from DefaultNetworkEvent.

IpConnectivityMetrics, IpConnectivityEventBuilder and associated tests
are updated as necessary.

Bug: 34901696
Test: runtest frameworks-net
Change-Id: I59b6e04fc126051320d08a422cfbd4d27042123e
diff --git a/services/core/java/com/android/server/connectivity/IpConnectivityMetrics.java b/services/core/java/com/android/server/connectivity/IpConnectivityMetrics.java
index 25e541f..24217e6 100644
--- a/services/core/java/com/android/server/connectivity/IpConnectivityMetrics.java
+++ b/services/core/java/com/android/server/connectivity/IpConnectivityMetrics.java
@@ -196,6 +196,8 @@
 
         final List<IpConnectivityEvent> protoEvents = IpConnectivityEventBuilder.toProto(events);
 
+        mDefaultNetworkMetrics.flushEvents(protoEvents);
+
         if (mNetdListener != null) {
             mNetdListener.flushStatistics(protoEvents);
         }
@@ -236,6 +238,7 @@
             if (mNetdListener != null) {
                 mNetdListener.listAsProtos(pw);
             }
+            mDefaultNetworkMetrics.listEventsAsProto(pw);
             return;
         }
 
@@ -245,6 +248,7 @@
         if (mNetdListener != null) {
             mNetdListener.list(pw);
         }
+        mDefaultNetworkMetrics.listEvents(pw);
     }
 
     /**
@@ -262,6 +266,7 @@
         if (mNetdListener != null) {
             mNetdListener.list(pw);
         }
+        mDefaultNetworkMetrics.listEvents(pw);
     }
 
     private void cmdStats(FileDescriptor fd, PrintWriter pw, String[] args) {