Added in API level 30

ConnectivityDiagnosticsCallback


abstract class ConnectivityDiagnosticsCallback
kotlin.Any
   ↳ android.net.ConnectivityDiagnosticsManager.ConnectivityDiagnosticsCallback

Abstract base class for Connectivity Diagnostics callbacks. Used for notifications about network connectivity events. Must be extended by applications wanting notifications.

Summary

Public constructors

Public methods
open Unit

Called when the platform completes a data connectivity check.

open Unit

Called when the platform suspects a data stall on some Network.

open Unit
onNetworkConnectivityReported(network: Network, hasConnectivity: Boolean)

Called when any app reports connectivity to the System.

Public constructors

ConnectivityDiagnosticsCallback

Added in API level 30
ConnectivityDiagnosticsCallback()

Public methods

onConnectivityReportAvailable

Added in API level 30
open fun onConnectivityReportAvailable(report: ConnectivityDiagnosticsManager.ConnectivityReport): Unit

Called when the platform completes a data connectivity check. This will also be invoked immediately upon registration for each network matching the request with the latest report, if a report has already been generated for that network.

The Network specified in the ConnectivityReport may not be active any more when this method is invoked.

Parameters
report ConnectivityDiagnosticsManager.ConnectivityReport: The ConnectivityReport containing information about a connectivity check This value cannot be null.

onDataStallSuspected

Added in API level 30
open fun onDataStallSuspected(report: ConnectivityDiagnosticsManager.DataStallReport): Unit

Called when the platform suspects a data stall on some Network.

The Network specified in the DataStallReport may not be active any more when this method is invoked.

Parameters
report ConnectivityDiagnosticsManager.DataStallReport: The DataStallReport containing information about the suspected data stall This value cannot be null.

onNetworkConnectivityReported

Added in API level 30
open fun onNetworkConnectivityReported(
    network: Network,
    hasConnectivity: Boolean
): Unit

Called when any app reports connectivity to the System.

Parameters
network Network: The Network for which connectivity has been reported This value cannot be null.
hasConnectivity Boolean: The connectivity reported to the System