ตั้งแต่วันที่ 27 มีนาคม 2025 เป็นต้นไป เราขอแนะนำให้ใช้ android-latest-release
แทน aosp-main
เพื่อสร้างและมีส่วนร่วมใน AOSP โปรดดูข้อมูลเพิ่มเติมที่หัวข้อการเปลี่ยนแปลงใน AOSP
สแต็กเครือข่าย
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
สแต็กเครือข่ายคือโมดูล Mainline ที่อัปเดตได้ ซึ่งช่วยให้ Android สามารถปรับตัวตามมาตรฐานเครือข่ายที่พัฒนาขึ้นและช่วยให้สามารถทำงานร่วมกันกับการใช้งานใหม่ๆ ได้ ตัวอย่างเช่น การอัปเดตการตรวจหาแคพทีฟพอร์ทัลและรหัสการเข้าสู่ระบบช่วยให้ Android ทันสมัยอยู่เสมอกับรูปแบบแคพทีฟพอร์ทัลที่เปลี่ยนแปลงไป และการอัปเดต APF ช่วยให้ Android ประหยัดพลังงานใน Wi-Fi ได้เมื่อแพ็กเก็ตประเภทใหม่ๆ กลายเป็นเรื่องปกติ
คอมโพเนนต์ที่รวมอยู่
โมดูลสแต็กเครือข่ายประกอบด้วยคอมโพเนนต์ต่อไปนี้ ในอุปกรณ์ที่ใช้ข้อบังคับนี้ บริการเหล่านี้จะย้ายไปยังกระบวนการอื่นและเข้าถึงผ่านอินเทอร์เฟซ AIDL ที่เสถียร
บริการ IP IpClient
(เดิมคือ IpManager
) คือคอมโพเนนต์ที่รับผิดชอบในการเตรียมการและการบำรุงรักษาเลเยอร์ IP ใน Android 9 คอมโพเนนต์ต่างๆ เช่น บลูทูธ ได้ใช้ MQTT ข้ามกระบวนการแล้ว และคอมโพเนนต์ต่างๆ เช่น Wi-Fi ได้ใช้ MQTT ในกระบวนการแล้ว DhcpClient
รับที่อยู่ IP จากเซิร์ฟเวอร์ DHCP เพื่อให้กำหนดให้กับอินเทอร์เฟซได้
NetworkMonitor คอมโพเนนต์ NetworkMonitor
จะทดสอบการเข้าถึงอินเทอร์เน็ตเมื่อเชื่อมต่อกับเครือข่ายใหม่หรือเมื่อเครือข่ายไม่ทำงาน เมื่อตรวจหาแคพทีฟพอร์ทัล และเมื่อตรวจสอบเครือข่าย
แอปการเข้าสู่ระบบแคพทีฟพอร์ทัล แอปที่ติดตั้งไว้ล่วงหน้าซึ่งมีหน้าที่จัดการการเข้าสู่ระบบในแคพทีฟพอร์ทัล ซึ่งเป็นแอปแยกต่างหากตั้งแต่ Android 5.0 แต่โต้ตอบกับ NetworkMonitor
เพื่อส่งต่อตัวเลือกบางอย่างของผู้ใช้ไปยังระบบ
เส้นทางที่ได้รับผลกระทบ
เส้นทางที่ย้ายไปยังโมดูลสแต็กเครือข่ายจากการแยกส่วนมีดังนี้
ตำแหน่งใหม่ของรหัสที่ย้ายคือ packages/modules/NetworkStack
,
packages/modules/CaptivePortalLogin
และตำแหน่งอื่นๆ ที่แชร์ เส้นทางข้างต้นหมายถึงตำแหน่งของไฟล์ก่อนที่จะย้ายไปยังตำแหน่งนั้นสำหรับ Mainline
ไฟล์ใน packages/modules/NetworkStack
และ packages/modules/CaptivePortalLogin
เป็นส่วนหนึ่งของโมดูล Mainline และแก้ไขไม่ได้
โมดูลสแต็กเครือข่ายประกอบด้วยคอมโพเนนต์ต่อไปนี้ในรูปแบบ APK
- บริการเกี่ยวกับทรัพย์สินทางปัญญา
- การเข้าสู่ระบบแคพทีฟพอร์ทัล (
com.google.android.captiveportallogin
)
โมดูลนี้มาพร้อมกับโมดูลการกําหนดค่าสิทธิ์สแต็กเครือข่าย ซึ่งเป็นไฟล์ APK ที่ติดตั้งไว้ล่วงหน้าซึ่งกําหนดสิทธิ์ที่จําเป็นสําหรับคอมโพเนนต์สแต็กเครือข่าย
ทรัพยากร Dependency
โมดูลสแต็กเครือข่ายจะขึ้นอยู่กับปัจจัยต่อไปนี้
เมธอด @hide ที่มีสิทธิ์ในเซิร์ฟเวอร์ระบบ (เช่น ใน IConnectivityManager.aidl
) API เหล่านี้ได้รับการทำให้เป็น @SystemApi
และได้รับการปกป้องอย่างเหมาะสมเพื่อให้โมดูล Mainline เข้าถึงได้ แต่แอปอื่นๆ ที่มีสิทธิ์เข้าถึงไม่ได้ (เช่น การใช้สิทธิ์ลายเซ็นใหม่)
Binder IPC ไปยัง netd
ที่กําหนดไว้ใน INetd.aidl
อินเทอร์เฟซนี้ได้รับการแปลงเป็น AIDL ที่เสถียรและอยู่ภายใต้การทดสอบการปฏิบัติตามข้อกำหนด
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-27 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-07-27 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."]]