Invoke onConnectivityReport on registering ConnectivityDiagnostics.

This change updates the behavior for registering
ConnectivityDiagnosticsCallbacks. Now, after a successful register()
call, callbacks will receive cached ConnectivityReports for all
matching, permissioned networks. This allows registrants to be updated
with the network state for their networks without having to wait for the
next network validation.

Bug: 147849853
Test: atest FrameworksNetTests
Change-Id: I924ba8fdcc847f453557021591bde38602fe089c
This commit is contained in:
Cody Kesting
2020-02-12 14:50:58 -08:00
parent 7b987276db
commit b77bf707c6
4 changed files with 95 additions and 1 deletions

View File

@@ -659,7 +659,8 @@ public class ConnectivityDiagnosticsManager {
public abstract static class ConnectivityDiagnosticsCallback {
/**
* Called when the platform completes a data connectivity check. This will also be invoked
* upon registration with the latest report.
* immediately upon registration with the latest report, if a report has already been
* generated for this network.
*
* <p>The Network specified in the ConnectivityReport may not be active any more when this
* method is invoked.