Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试通过特定的 sim 插槽查找数据使用情况。为此,我使用了 TrafficStats.getMobileRxBytes() 方法,但它提供了双 sim 卡设备中两个 sim 卡的总使用量。我想要个人 sim 的特定数据使用情况。任何建议将不胜感激。
只是一个提示:您可以在 sim slot 数据活动事件 TrafficStats.setThreadStatsTag(identifier_tag); 上执行类似操作
和
if(TrafficStats.getThreadStatsTag() == SIM1_SLOT){ int usedBytes = TrafficStats.getMobileRxBytes() }else{ // Sim2 slot int usedBytes = TrafficStats.getMobileRxBytes() }