tree: d8230861a4a07101b96361625044fd1686833e96 [path history] [tgz]
  1. BUILD.gn
  2. DEPS
  3. network_health_manager.cc
  4. network_health_manager.h
  5. network_health_service_policy.json
  6. OWNERS
  7. README.md
chrome/browser/ash/net/network_health/README.md

Network Events

Notifies clients of network events. Design Doc

This code is maintained by the Network Health and Configuration team. See also documentation for Network Diagnostic Routines and Network Health telemetry.

Listening to network events

Clients interested in listening to network events may implement the NetworkEventsObserver Mojo interface, defined in network_health.mojom. The remote end of the NetworkEventsObserver interface must be added as an observer to the NetworkHealthService Mojo interface, also defined in network_health.mojom. Chrome clients can interact with the NetworkHealthService Mojo interface by using the global NetworkHealthService class. Note that Chrome OS clients may listen to network events through the cros_healthd daemon by adding a NetworkEventsObserver remote to cros_healthd. TODO(khegde): Replace CL with source once this lands.

Available network events

See NetworkEventsObserver in network_health.mojom for available events.

Demo Run

The following is an example run that uses the cros-health-tool to listen for network events.

  1. Ensure the active network is online. Then, start cros-health-tool:
    $cros-health-tool event --category=network --length_seconds=150

  2. Disconnect the active network. Output:
    Network event received: Connection state changed, Network guid: fake-guid, Connection state: NetworkState::kNotConnected

  3. Reconnect the active network. Output:
    Network event received: Connection state changed, Network guid: fake-guid, Connection state: NetworkState::kConnecting
    Network event received: Signal strength changed, Network guid: fake-guid, Signal strength: 60
    Network event received: Connection state changed, Network guid: fake-guid, Connection state: NetworkState::kConnected
    Network event received: Connection state changed, Network guid: fake-guid, Connection state: NetworkState::kOnline

  4. Move the device to a region with weaker signal strength. Output:
    Network event received: Signal strength changed, Network guid: fake-guid, Signal strength: 48