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
Change-Id: I2dbfc9bf7b2f785ea4594851bd354e9fd0fc0bd1
This commit is contained in:
Remi NGUYEN VAN
2020-04-24 20:56:39 +09:00
parent 9b647ca69a
commit 455b93d137

View File

@@ -3002,10 +3002,13 @@ public class ConnectivityService extends IConnectivityManager.Stub
// Legacy version of notifyNetworkTestedWithExtras. // Legacy version of notifyNetworkTestedWithExtras.
// Would only be called if the system has a NetworkStack module older than the // Would only be called if the system has a NetworkStack module older than the
// framework, which does not happen in practice. // framework, which does not happen in practice.
Slog.wtf(TAG, "Deprecated notifyNetworkTested called: no action taken");
} }
@Override @Override
public void notifyNetworkTestedWithExtras(NetworkTestResultParcelable p) { 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( final Message msg = mTrackerHandler.obtainMessage(
EVENT_NETWORK_TESTED, EVENT_NETWORK_TESTED,
new NetworkTestedResults( new NetworkTestedResults(