检测 eSIM 卡和 SIM 卡
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
装有 SIM 卡和 eSIM 卡的 Android 设备在电话 API 中使用以下 ID,包括 TelephonyManager
和 SubscriptionManager
:
- 订阅 ID:移动订阅的唯一 ID。
- 逻辑插槽索引或 ID:指向逻辑 SIM 卡插槽的唯一索引。逻辑插槽 ID 从 0 开始,并且根据设备上支持的活跃插槽数量而增加。例如,双 SIM 卡设备通常具有插槽 0 和插槽 1。如果设备具有多个实体槽位,但仅支持一个活动槽位,则其逻辑槽位 ID 仅为 0。
- 实体插槽索引或 ID:引用实体 SIM 卡插槽的唯一索引。实体插槽 ID 从 0 开始,并且根据设备上的物理插槽数量而增加。这不同于设备的逻辑插槽数量,后者对应的是设备能够使用的活动插槽数量。例如,在双 SIM 卡模式和单 SIM 卡模式之间切换的设备可能始终具有两个实体插槽,但在单 SIM 卡模式下,它只有一个逻辑插槽。
- 卡 ID:用于识别 UiccCard 的唯一 ID。

在上图中:
- 该设备有两个逻辑插槽。
- 实体插槽 0 中有一个具有有效配置文件的实体 UICC 卡。
- 实体插槽 2 中是一个具有有效配置文件的 eUICC。
- 实体插槽 1 当前未在使用。

在上图中:
- 该设备有三个逻辑插槽。
- 实体插槽 0 中有一个具有有效配置文件的实体 UICC 卡。
- 实体插槽 1 中是一个具有两个已下载配置文件的 eUICC,两个配置文件都使用 MEP(多个已启用的配置文件)处于活动状态。
Open Mobile API (OMAPI) 读取器支持
在 Android 11 及更高版本中,Open Mobile API (OMAPI) 支持在带有以下标志的设备上检查 eSE、SD 和 UICC 支持硬件:
将这些值与 getSystemAvailableFeatures()
或 hasSystemFeature()
结合使用,可检查设备是否支持。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[null,null,["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# Detect eSIMs and SIM cards\n\nAndroid-powered devices with SIM cards and eSIMs use the following IDs in the telephony\nAPIs, including\n[`TelephonyManager`](/reference/android/telephony/TelephonyManager) and\n[`SubscriptionManager`](/reference/android/telephony/SubscriptionManager):\n\n- Subscription ID: unique ID for a mobile subscription.\n- Logical slot index or ID: unique index referring to a logical SIM slot. Logical slot IDs start at 0 and go up depending on the number of supported active slots on a device. For example, a dual-SIM device typically has slot 0 and slot 1. If a device has multiple physical slots but only supports one active slot, it will have only the logical slot ID 0.\n- Physical slot index or ID: unique index referring to a physical SIM slot. Physical slot IDs start at 0 and go up depending on the number of physical slots on the device. This differs from the number of logical slots a device has, which corresponds to the number of active slots a device is capable of using. For example, a device which switches between dual-SIM and single-SIM mode may always have two physical slots, but in single-SIM mode it will have only one logical slot.\n- Card ID: unique ID used to identify a UiccCard.\n\nIn the preceding diagram:\n\n- The device has two logical slots.\n- In physical slot 0 there is a physical UICC card with an active profile.\n- In physical slot 2 is an eUICC with an active profile.\n- Physical slot 1 is not currently in use.\n\nIn the preceding diagram:\n\n- The device has three logical slots.\n- In physical slot 0 there is a physical UICC card with an active profile.\n- In physical slot 1 is an eUICC that has two downloaded profiles, both active using MEP (Multiple Enabled Profiles).\n\nOpen Mobile API (OMAPI) reader support\n--------------------------------------\n\nOn Android 11 and higher, Open Mobile API (OMAPI) supports checking for eSE, SD,\nand UICC support hardware on devices with the following flags:\n\n- [`FEATURE_SE_OMAPI_ESE`](/reference/android/content/pm/PackageManager#FEATURE_SE_OMAPI_ESE)\n- [`FEATURE_SE_OMAPI_SD`](/reference/android/content/pm/PackageManager#FEATURE_SE_OMAPI_SD)\n- [`FEATURE_SE_OMAPI_UICC`](/reference/android/content/pm/PackageManager#FEATURE_SE_OMAPI_UICC)\n\nUse these values with\n[`getSystemAvailableFeatures()`](/reference/android/content/pm/PackageManager#getSystemAvailableFeatures())\nor\n[`hasSystemFeature()`](/reference/android/content/pm/PackageManager#hasSystemFeature(java.lang.String))\nto check for device support."]]