private void getCellIdentity() {
List<CellInfo> cellInfoList = mTM.getAllCellInfo();
if (cellInfoList == null) {
//Log.e(Tag,"getAllCellInfo is null");
return;
}
//Log.e(Tag,"getAllCellInfo size "+cellInfoList.size());
for (CellInfo cellInfo : cellInfoList) {
if (!cellInfo.isRegistered())
continue;
if (cellInfo instanceof CellInfoLte) {
CellInfoLte lteinfo = (CellInfoLte) cellInfo;
lte_MCC = lteinfo.getCellIdentity().getMcc();
lte_MNC = lteinfo.getCellIdentity().getMnc();
lte_CI = lteinfo.getCellIdentity().getCi();
lte_PCI = lteinfo.getCellIdentity().getPci();
lte_TAC = lteinfo.getCellIdentity().getTac();
//Log.e(Tag,lteinfo.toString());
} else if (cellInfo instanceof CellInfoCdma) {
CellInfoCdma cdmainfo = (CellInfoCdma) cellInfo;
cdma_SID = cdmainfo.getCellIdentity().getSystemId();
cdma_NID = cdmainfo.getCellIdentity().getNetworkId();
cdma_BSID = cdmainfo.getCellIdentity().getBasestationId();
//Log.e(Tag,cdmainfo.toString());
} else if (cellInfo instanceof CellInfoGsm) {
CellInfoGsm gsmInfo = (CellInfoGsm) cellInfo;
gsm_MCC = gsmInfo.getCellIdentity().getMcc();
gsm_MNC = gsmInfo.getCellIdentity().getMnc();
gsm_CID = gsmInfo.getCellIdentity().getCid();
gsm_LAC = gsmInfo.getCellIdentity().getLac();
} else if (cellInfo instanceof CellInfoWcdma) {
CellInfoWcdma wcdmaInfo = (CellInfoWcdma) cellInfo;
wcdma_MCC = wcdmaInfo.getCellIdentity().getMcc();
wcdma_MNC = wcdmaInfo.getCellIdentity().getMnc();
wcdma_CID = wcdmaInfo.getCellIdentity().getCid();
wcdma_LAC = wcdmaInfo.getCellIdentity().getLac();
wcdma_PSC = wcdmaInfo.getCellIdentity().getPsc();
}
}
}
RadioInfo.java 文件源码
java
阅读 18
收藏 0
点赞 0
评论 0
项目:CellularSignal
作者:
评论列表
文章目录