有谁知道返回的列表中的单元格索引TelephonyManager.getAllCellInfo()
是否与 SIM 插槽号有关?
我正在使用Android API 24 ...
经过一番试验,似乎运行该方法updateCellInfo
(如下所述)总是返回一个列表,其中它的第一个索引对应于设备的最后一个 SIM 插槽,它的最后一个索引对应于设备的第一个 SIM 插槽。
有人可以证实这一点吗?这种相关性是否合理?
private ArrayList<CellInfo> updateCellInfo(ArrayList<CellInfo> cellInfo)
{
//Create new ArrayList
ArrayList<CellInfo> cellInfos= new ArrayList<>();
//cellInfo is obtained from telephonyManager.getAllCellInfo()
if(cellInfo.size()!=0)
{
for (int i = 0; i < cellInfo.size(); i++)
{
//Return registered cells only
int index=0;
CellInfo temp=cellInfo.get(i);
if (temp.isRegistered())
{
cellInfos.add(index, temp);
index++;
}
}
}
return cellInfos;
}