From edf5c248b9298217137c4b919a6ab896090006e7 Mon Sep 17 00:00:00 2001 From: Hugo Benichi Date: Sat, 11 Nov 2017 08:06:43 +0900 Subject: [PATCH] IP connectivity metrics: fix LINGER/UNLINGER logging This patch fixes a regression introduced by commit 97bfd276fb008 for logging NetworkEvents when lingering and unlingering a network. Commit 97bfd276fb008 removed an overloaded constructor for the NetworkEvent class, which caused NetworkEvents with event type of LINGER or UNLINGER logged in ConnectivityService to have incorrect event types (set to the network id instead) and incorrect duration (set as the event type instead). Bug: 34901696 Test: runtest frameworks-net Change-Id: Iab97a58ca805413617c8e8b4553404625a820ceb --- services/core/java/com/android/server/ConnectivityService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java index 664c2abdffd3d..ce19a1c20134e 100644 --- a/services/core/java/com/android/server/ConnectivityService.java +++ b/services/core/java/com/android/server/ConnectivityService.java @@ -5605,7 +5605,8 @@ public class ConnectivityService extends IConnectivityManager.Stub } private void logNetworkEvent(NetworkAgentInfo nai, int evtype) { - mMetricsLog.log(new NetworkEvent(nai.network.netId, evtype)); + int[] transports = nai.networkCapabilities.getTransportTypes(); + mMetricsLog.log(nai.network.netId, transports, new NetworkEvent(evtype)); } private static boolean toBool(int encodedBoolean) {