2025 年 3 月 27 日より、AOSP のビルドとコントリビューションには aosp-main
ではなく android-latest-release
を使用することをおすすめします。詳細については、AOSP の変更をご覧ください。
Network Stack
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Network Stack は更新可能な Mainline モジュールです。Android が進化するネットワーク標準に適応できるようにして、新しい実装との相互運用を可能にします。たとえば、Android はキャプティブ ポータル検出とログインコードの更新を通じて、キャプティブ ポータルモデルの変化に対応できます。また、新しいタイプのパケットが一般的になったときに、APF の更新を通じて Wi-Fi の電力を節約できます。
含まれるコンポーネント
Network Stack モジュールには、次のコンポーネントが含まれています。このモジュールを使用するデバイスでは、これらのサービスは別のプロセスに移行され、安定版の AIDL インターフェースを介してアクセスされます。
IP サービス。IpClient
(旧 IpManager
)は、IP レイヤのプロビジョニングとメンテナンスを担うコンポーネントです。Android 9 では、Bluetooth などのコンポーネントによってクロスプロセスで、Wi-Fi などのコンポーネントによってインプロセスで使用されていました。DhcpClient
は、DHCP サーバーから IP アドレスを取得してインターフェースに割り当てます。
NetworkMonitor。NetworkMonitor
コンポーネントは、ネットワークの新規接続時や障害発生時、キャプティブ ポータルの検出時、ネットワークの検証時に、インターネットへの到達性をテストします。
キャプティブ ポータル ログインアプリ。キャプティブ ポータルのログイン操作を管理するプリインストール アプリ。Android 5.0 以降は独立したアプリですが、NetworkMonitor
とやり取りしていくつかのユーザーの選択をシステムに転送します。
影響を受けるパス
リファクタリングによって Network Stack モジュールに移動されるパスは次のとおりです。
移動されたコードは、packages/modules/NetworkStack
、packages/modules/CaptivePortalLogin
のほかいくつかの共有場所にあります。上記のパスは、Mainline で移動される前のファイルの場所を表します。packages/modules/NetworkStack
と packages/modules/CaptivePortalLogin
内のファイルは Mainline モジュールの一部であり、変更できません。
Network Stack モジュールには、APK 形式の次のコンポーネントが含まれています。
- IP サービス
- Captive Portal Login(
com.google.android.captiveportallogin
)
このモジュールには、Network Stack Permission Config モジュールが付属しています。これは、Network Stack コンポーネントに必要な権限を定義するプリインストール APK ファイルです。
依存関係
Network Stack モジュールは以下に依存します。
システム サーバー内の特権 @hide メソッド(IConnectivityManager.aidl
内など)。これらの API は @SystemApi
になり、適切に保護されるため、Mainline モジュールからはアクセスできますが、他の特権アプリからはアクセスできません(新しい署名権限を使用するなど)。
INetd.aidl
で定義される netd
を指す Binder IPC。このインターフェースは安定版の AIDL に変換されており、適合性テストの対象となります。
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-03-26 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-03-26 UTC。"],[],[],null,["# Network Stack is an updatable Mainline module that ensures that Android can\nadapt to evolving network standards and allows for interoperability with new\nimplementations. For example, updates to captive portal detection and login code\nallow Android to stay up to date with changing captive portal models, and\nupdates to APF allow Android to save power on Wi-Fi as new types of packets\nbecome common.\n\nIncluded components\n-------------------\n\nThe Network Stack module contains the following components. On devices using the\nmodule, these services were moved to a different process and are accessed\nthrough a stable AIDL interface.\n\n- **IP services.** `IpClient` (formerly `IpManager`) is a component in charge of\n IP layer provisioning and maintenance. In Android 9, it was already used\n cross-process by components such as Bluetooth, and in-process by components\n such as Wi-Fi. `DhcpClient` obtains IP addresses from DHCP servers so they can\n be assigned to interfaces.\n\n- **NetworkMonitor.** The `NetworkMonitor` component tests for internet\n reachability when connecting to a new network or upon network failures, when\n detecting captive portals, and when validating networks.\n\n- **Captive portal login app.** A preinstalled app in charge of managing login\n on captive portals. This has been a separate app since Android 5.0, but it\n interacts with `NetworkMonitor` to forward some user choices to the system.\n\nAffected paths\n--------------\n\nThe paths moved to the Network Stack module by the refactor are listed below.\n\n- **IP services.** In `frameworks/base/services/net/java/android/net/`:\n\n - `apf`\n - `dhcp`\n - `ip`\n - `netlink`\n - `util` (partly)\n- **Captive portal detection and login.** In `frameworks/base/`:\n\n - `core/java/android/net/captiveportal/`\n - `services/core/java/com/android/server/connectivity/NetworkMonitor.java`\n - `packages/CaptivePortalLogin/*`\n\nThe new location of the moved code is in `packages/modules/NetworkStack`,\n`packages/modules/CaptivePortalLogin` and some other shared locations. The above\npaths refer to the location of files before being moved there for Mainline.\nFiles in `packages/modules/NetworkStack` and\n`packages/modules/CaptivePortalLogin` are part of the Mainline module and cannot\nbe modified.\n\nPackage format\n--------------\n\nThe Network Stack module contains the following components in APK format:\n\n- IP services\n- Captive portal login (`com.google.android.captiveportallogin`)\n\nThis module is accompanied by the Network Stack Permission Config module,\nwhich is a pre-installed APK file that defines the necessary permissions for the\nNetwork Stack components.\n\nDependencies\n------------\n\nThe Network Stack module depends on the following:\n\n- Privileged @hide methods in the system server (e.g., in\n `IConnectivityManager.aidl`). These APIs have been made `@SystemApi` and\n appropriately protected so that they are accessible to the Mainline module but\n not other privileged apps (e.g., using a new signature permission).\n\n- Binder IPCs to `netd` defined in\n [`INetd.aidl`](https://android.googlesource.com/platform/system/netd/+/android16-release/server/binder/android/net/INetd.aidl).\n This interface has been converted to stable AIDL and is subject to conformance\n tests."]]