如何在5g SA中获取cellid和pci

How to get cellid and pci in 5g SA

我正在开发一个应用程序,其中我需要一些网络参数小区 ID 并且 pci.I 具有 5g 启用设备 android 10。我正在尝试通过电话管理器访问小区 ID 这是代码.

List<CellInfo> allCellInfo = telephonyManager.getAllCellInfo();

for (CellInfo info : allCellInfo){ if (info instanceof CellInfoNr && info.isRegistered()){ }}

但是 allCellInfo 得到 null.I 我在谈论 5g SA(高通设备)。

我看过这个 post this 但没有多大帮助。请帮忙

所以搜索了很多但没有找到任何相关答案最后我将我的 Android 10 5g 设备更新为 Android 11 5g 设备并且它对我来说具有相同的功能。