ตั้งแต่วันที่ 27 มีนาคม 2025 เป็นต้นไป เราขอแนะนำให้ใช้ android-latest-release
แทน aosp-main
เพื่อสร้างและมีส่วนร่วมใน AOSP โปรดดูข้อมูลเพิ่มเติมที่หัวข้อการเปลี่ยนแปลงใน AOSP
5G แบบไม่สแตนด์อโลน (NSA)
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
อุปกรณ์ที่ใช้ Android 10 ขึ้นไปรองรับ 5G แบบไม่สแตนด์อโลน (NSA) 5G NSA เป็นโซลูชันสำหรับเครือข่าย 5G ที่โครงสร้างพื้นฐาน 4G ที่มีอยู่รองรับเครือข่าย ใน Android 10 อุปกรณ์จะแสดงไอคอน 5G ในแถบสถานะเมื่อเชื่อมต่อกับเครือข่าย 5G
การใช้งาน
การกำหนดค่าผู้ให้บริการ
หากต้องการกำหนดค่าวิธีแสดงไอคอน 5G ในแถบสถานะ ผู้ให้บริการสามารถใช้คีย์ KEY_5G_ICON_CONFIGURATION_STRING
ใน CarrierConfig
สถานการณ์เหล่านี้พร้อมใช้งานใน 5G NSA
- อุปกรณ์ที่เชื่อมต่อกับเซลล์ 5G เป็นเซลล์รองและใช้คลื่นมิลลิเมตร
- อุปกรณ์เชื่อมต่อกับสถานีฐาน 5G เป็นสถานีฐานรองแต่ไม่ได้ใช้คลื่นมิลลิเมตร
- อุปกรณ์แคมปในเครือข่ายที่มีความสามารถ 5G (อุปกรณ์ไม่จำเป็นต้องเชื่อมต่อกับเซลล์ 5G เป็นเซลล์รอง) และการใช้งาน 5G ไม่ได้ถูกจํากัด และการควบคุมทรัพยากรวิทยุ (RRC) อยู่ในสถานะ
IDLE
(ไม่มีการเชื่อมต่อ)
- อุปกรณ์แคมปในเครือข่ายที่มีความสามารถ 5G (อุปกรณ์ไม่จำเป็นต้องเชื่อมต่อกับเซลล์ 5G เป็นเซลล์รอง) และการใช้ 5G ไม่ได้ถูกจำกัด และการควบคุมทรัพยากรวิทยุ (RRC) อยู่ในสถานะ
CONNECTED
- อุปกรณ์แคมปในเครือข่ายที่มีความสามารถ 5G (อุปกรณ์ไม่จำเป็นต้องเชื่อมต่อกับเซลล์ 5G เป็นเซลล์รอง) แต่การใช้งาน 5G ถูกจำกัด
สตริงการกําหนดค่ามีคู่คีย์-ค่าหลายคู่ที่คั่นด้วยคอมมา
คีย์และค่าของคู่แต่ละคู่จะคั่นด้วยโคลอน คีย์ในสตริงการกําหนดค่าจะสอดคล้องกับสถานการณ์ 5G ที่อธิบายไว้ข้างต้น และต้องเป็นคีย์อย่างใดอย่างหนึ่งต่อไปนี้
connected_mmwave
connected
not_restricted_rrc_idle
not_restricted_rrc_con
restricted
ค่าในสตริงการกําหนดค่าต้องเป็นชื่อไอคอนที่ถูกต้องซึ่งตรงกับชื่อไอคอนในไดเรกทอรี /packages/SettingsLib/res/
ไอคอนเริ่มต้นสำหรับ 5G NSA มี 2 ไอคอน ได้แก่ 5G
และ 5G_PLUS
รูปที่ 1 ไอคอน 5G เริ่มต้นและไอคอน 5G_PLUS
แสดงไอคอน 5G เฉพาะสำหรับสถานการณ์ 1 (connected_mmwave
) และสถานการณ์ 2 (connected
) ที่อุปกรณ์มีการเชื่อมต่อ 5G จริง ใช้ไอคอน 5G_PLUS
สำหรับสถานการณ์ 1 และไอคอน 5G
สำหรับสถานการณ์ 2 ต่อไปนี้คือตัวอย่างสตริงการกําหนดค่าใน CarrierConfig
connected_mmwave:5G_PLUS,connected:5G
UI ของระบบ
หากต้องการปรับแต่งไอคอนที่ผู้ให้บริการสามารถใช้สำหรับสถานะหนึ่งๆ ให้เพิ่มออบเจ็กต์ MobileIconGroup
ใน TelephonyIcons.java
ชื่อไอคอนใน MobileIconGroup
ต้องตรงกับชื่อไอคอนที่ใช้ใน
CarrierConfig
ตัวอย่างต่อไปนี้แสดงวิธีเพิ่มไอคอนที่กําหนดเองซึ่งมีชื่อ "5G_PLUS" ลงใน MobileIconGroup
static final MobileIconGroup NR_5G_PLUS = new MobileIconGroup(
"5G_PLUS",
null,
null,
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
0,
0,
0,
0,
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
R.string.data_connection_5g_plus,
TelephonyIcons.ICON_5G_PLUS,
true);
การตรวจสอบความถูกต้อง
หากต้องการตรวจสอบการติดตั้งใช้งาน ให้ตรวจสอบว่าไอคอน 5G แสดงในแถบสถานะเมื่ออุปกรณ์เชื่อมต่อกับเครือข่าย 5G
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-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-07-26 UTC"],[],[],null,["# 5G non-standalone (NSA)\n\nDevices running Android 10 or higher can support 5G\nnon-standalone (NSA). 5G NSA\nis a solution for 5G networks where the network is supported by the existing 4G\ninfrastructure. On Android 10, devices can display a\n5G icon on the status bar\nwhen a device connects to a 5G network.\n\nImplementation\n--------------\n\n### Carrier configuration\n\nTo configure how 5G icons are displayed on the status bar, carriers can use the\n[`KEY_5G_ICON_CONFIGURATION_STRING`](https://android.googlesource.com/platform/frameworks/base/+/refs/heads/android16-release/telephony/java/android/telephony/CarrierConfigManager.java#2459)\nkey in `CarrierConfig`.\n\nThese scenarios are available in 5G NSA:\n\n1. Device connected to 5G cell as the secondary cell and using millimeter wave.\n2. Device connected to 5G cell as the secondary cell but not using millimeter wave.\n3. Device camped on a network that has 5G capability (device doesn't have to be connected to a 5G cell as a secondary cell) and the use of 5G isn't restricted and radio resource control (RRC) is in the `IDLE` state (no connection).\n4. Device camped on a network that has 5G capability (device doesn't have to be connected to a 5G cell as a secondary cell) and the use of 5G isn't restricted and radio resource control (RRC) is in the `CONNECTED` state.\n5. Device camped on a network that has 5G capability (device doesn't have to be connected to a 5G cell as a secondary cell) but the use of 5G is restricted.\n\nThe configuration string contains multiple key-value pairs separated by commas.\nFor each pair, the key and value are separated by a colon. The keys in the\nconfiguration string correspond to the 5G scenarios described above\nand must be one of the following:\n\n1. `connected_mmwave`\n2. `connected`\n3. `not_restricted_rrc_idle`\n4. `not_restricted_rrc_con`\n5. `restricted`\n\nThe values in the configuration string must be valid icon names that match the\nnames of icons in the `/packages/SettingsLib/res/` directory. Two default icons\nfor 5G NSA are available: `5G` and `5G_PLUS`.\n\n**Figure 1.** Default 5G and 5G_PLUS 5G icons\n\nDisplay the 5G icons only for scenario 1 (`connected_mmwave`) and\nscenario 2 (`connected`), where the device has a true 5G connection. Use the\n`5G_PLUS` icon for scenario 1 and the `5G` icon for scenario 2. The\nfollowing is an example of a configuration string in `CarrierConfig`. \n\n connected_mmwave:5G_PLUS,connected:5G\n\n### System UI\n\nTo customize the icons that carriers can use for a specific status, add a\n`MobileIconGroup` object in\n[`TelephonyIcons.java`](https://cs.android.com/android/platform/superproject/+/android-latest-release:frameworks/base/packages/SettingsLib/src/com/android/settingslib/mobile/TelephonyIcons.java).\nThe icon name in `MobileIconGroup` must match the icon name used in\n`CarrierConfig`. The following shows an example of how to add a customized icon\nwith the name \"5G_PLUS\" to `MobileIconGroup`. \n\n static final MobileIconGroup NR_5G_PLUS = new MobileIconGroup(\n \"5G_PLUS\",\n null,\n null,\n AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,\n 0,\n 0,\n 0,\n 0,\n\n AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],\n R.string.data_connection_5g_plus,\n TelephonyIcons.ICON_5G_PLUS,\n true);\n\nValidation\n----------\n\nTo validate your implementation, make sure a 5G icon is displayed on the status\nbar when the device is connected to a 5G cell."]]