问题描述
我正在开发一个应用,其中我需要一些网络参数 cell id 和 pci。我有 5g 启用设备和 android 10。我试图通过电话管理器访问 cell id,这里是代码。
List<CellInfo> allCellInfo = telephonyManager.getAllCellInfo();
for (CellInfo info : allCellInfo){ if (info instanceof CellInfoNr && info.isRegistered()){ }}
但是 allCellInfo 变为 null。我说的是 5g SA(高通设备)。
解决方法
所以搜索了很多,但没有找到任何相关的答案,最后我将我的 Android 10 5g 设备更新为 Android 11 5g 设备,它对我来说具有相同的功能。