Network Stack is an updatable Mainline module that 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 APF allow Android to save power on Wi-Fi as new types of packets become common.
The Network Stack module contains the following components. On devices using the module, these services were moved to a different process and are accessed through a stable AIDL interface.
IpManager) is a component in charge of IP layer provisioning and maintenance. In Android 9, it was already used cross-process by components such as Bluetooth, and in-process by components such as Wi-Fi.
DhcpClientobtains IP addresses from DHCP servers so they can be assigned to interfaces.
NetworkMonitorcomponent 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. 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
NetworkMonitorto forward some user choices to the system.
The paths moved to the Network Stack module by the refactor are listed below.
IP services. In
Captive portal detection and login. In
The new location of the moved code is in
packages/modules/CaptivePortalLogin and some other shared locations. The above
paths refer to the location of files before being moved there for Mainline.
packages/modules/CaptivePortalLogin are part of the Mainline module and cannot
The Network Stack module contains the following components in APK format:
- IP services
- Captive portal login (
This module is accompanied by the Network Stack Permission Config module, which is a pre-installed APK file that defines the necessary permissions for the Network Stack components.
The Network Stack module depends on the following:
Privileged @hide methods in the system server (e.g., in
IConnectivityManager.aidl). These APIs have been made
@SystemApiand appropriately protected so that they are accessible to the Mainline module but not other privileged apps (e.g., using a new signature permission).
Binder IPCs to
INetd.aidl. This interface has been converted to stable AIDL and is subject to conformance tests.