【Android Q】Android Q SIM_STATE_CHANGED无法获取slotId或者phoneId

本文探讨了在调试NFC部分热插NFCSIM激活SWP时遇到的问题,即SIM_STATE_CHANGED广播的Extra数据中缺失slotId,导致流程无法继续。通过对比异常log与正常log,定位到问题根源,并提供了临时解决方案。同时,提到了Google在SubscriptionInfoUpdater的更新可能已修复此问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

这几天调试适配NFC部分热插NFC SIM激活SWP时。

发现,

总是无法成功,经过调试原来根本原因是SIM_STATE_CHANGED广播的Extra数据已经不再具有slotId, 拿不到。

接下来的流程跑步下去了。

发现QCOM 和MediaTek 基线都是如此。

异常log如下:

08-02 00:04:08.168  2463  2463 D NfcSimStateObserver: onReceive: android.intent.action.SIM_STATE_CHANGED
08-02 00:04:08.168  2463  2463 D NfcSimStateObserver: ACTION_SIM_STATE_CHANGED receiver with iccState = LOADED, simId = -1
08-02 00:04:08.168  2463  2463 D Nfc_SecureElementSelector: onSimStateChanged() - simId = -1 newPresenceState = 2 mUICC1State: Active mUICC2State: ? airplane: false
08-02 00:04:08.168  2463  2463 D Nfc_SecureElementSelector: onSimStateChanged() - simId not supported -1
08-02 00:04:08.507  2463  2463 D NfcSimStateObserver: onReceive: android.intent.action.SIM_STATE_CHANGED
08-02 00:04:08.507  2463  2463 D NfcSimStateObserver: ACTION_SIM_STATE_CHANGED receiver with iccState = LOADED, simId = -1
08-02 00:04:08.507  2463  2463 D Nfc_SecureElementSelector: onSimStateChanged() - simId = -1 newPresenceState = 2 mUICC1State: Active mUICC2State: ? airplane: false
08-02 00:04:08.507  2463  2463 D Nfc_SecureElementSelector: onSimStateChanged() - simId not supported -1

原来正常log如下:

08-09 06:49:57.206  4048  4048 D NfcSimStateObserver: onReceive: android.intent.action.SIM_STATE_CHANGED
08-09 06:49:57.206  4048  4048 D NfcSimStateObserver: ACTION_SIM_STATE_CHANGED receiver with iccState = LOADED, simId = 0
08-09 06:49:57.206  4048  4048 D Nfc_SecureElementSelector: onSimStateChanged() - simId =
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值