From 3d3c9f7b76751dda461c9252c52c005241efaa69 Mon Sep 17 00:00:00 2001 From: Remi NGUYEN VAN Date: Mon, 27 Apr 2020 08:08:57 +0000 Subject: [PATCH] Add comment / logging in NetworkMonitor callbacks Add a comment explaining the ordering of messages sent to the tracker and connectivity diagnostics handlers. Add a Slog.wtf call in case the deprecated notifyNetworkTested callback is called. Bug: 153500847 Test: atest ConnectivityServiceTest Merged-In: I2dbfc9bf7b2f785ea4594851bd354e9fd0fc0bd1 Change-Id: I2dbfc9bf7b2f785ea4594851bd354e9fd0fc0bd1 --- services/core/java/com/android/server/ConnectivityService.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java index e4eb585e98..2c63c6f8a6 100644 --- a/services/core/java/com/android/server/ConnectivityService.java +++ b/services/core/java/com/android/server/ConnectivityService.java @@ -3011,10 +3011,13 @@ public class ConnectivityService extends IConnectivityManager.Stub // Legacy version of notifyNetworkTestedWithExtras. // Would only be called if the system has a NetworkStack module older than the // framework, which does not happen in practice. + Slog.wtf(TAG, "Deprecated notifyNetworkTested called: no action taken"); } @Override public void notifyNetworkTestedWithExtras(NetworkTestResultParcelable p) { + // Notify mTrackerHandler and mConnectivityDiagnosticsHandler of the event. Both use + // the same looper so messages will be processed in sequence. final Message msg = mTrackerHandler.obtainMessage( EVENT_NETWORK_TESTED, new NetworkTestedResults(