Networking

Android 10 includes the following networking modules:

  • The Networking Components module provides common IP services, network connectivity monitoring, and captive login portal detection.
  • The Network Stack Permission Config module defines a permission that enables modules to perform network-related tasks.

Networking Components module

The Networking Components module ensures that Android can adapt to evolving network standards and allows for interoperability with new implementations. For example, updates to captive portal detection and login code allow Android to stay up to date with changing captive portal models, and updates to Advanced Policy Firewall (APF) allow Android to save power on Wi-Fi as new types of packets become common.

Changes in Android 10

The Networking Components module contains the following components.

  • IP services. The IpClient (formerly IpManager) component handles IP layer provisioning and maintenance. In Android 9, it was used cross-process by components such as Bluetooth, and in-process by components such Wi-Fi. The DhcpClient component obtains IP addresses from DHCP servers so they can be assigned to interfaces.
  • NetworkMonitor. The NetworkMonitor component tests for internet reachability when connecting to a new network or upon network failures, when detecting captive portals, and when validating networks.
  • Captive portal login app. The Captive portal login app is a preinstalled app in charge of managing login on captive portals. This has been a separate app since Android 5.0, but it interacts with NetworkMonitor to forward some user choices to the system.

On devices using the Networking Components module, the above services are refactored to a different process and are accessed using a stable AIDL interfaces. The refactor paths are shown in the following tables.

IP Services refactor paths

Android 9 and lower In frameworks/base/services/net/java/android/net/:
  • apf
  • dhcp
  • ip
  • netlink
  • util (partly)
Android 10 and higher packages/modules/NetworkStack

Captive Portal Login refactor paths

Android 9 and lower In frameworks/base/:
  • core/java/android/net/captiveportal/
  • services/core/java/com/android/server/connectivity/NetworkMonitor.java
  • packages/CaptivePortalLogin/* (where * = wildcard)
Android 10 and higher packages/modules/CaptivePortalLogin (and some other shared locations)

Format and dependencies

The Networking Components module is delivered as three APKs: one for IP services, one for captive portal login, and one for Network Stack Permission Config.

The Networking Components module depends on the following:

  • Privileged @hide methods in the system server (for example, in IConnectivityManager.aidl). These APIs have been annotated with @SystemApi and appropriately protected so that they're accessible to the module but not other privileged apps (for example, using a new signature permission).
  • Binder IPCs to netd defined in INetd.aidl. This interface has been converted to stable AIDL and is subject to conformance tests.

Network Stack Permission Config module

The Network Stack Permission Config module contains no code but instead defines a permission intended for use by the Network Stack and Captive Portal Login modules. The system allows modules granted this permission to perform related network configuration tasks on the device.