/**
* Adds or updates a list of cell towers.
* <p>
* This method first calls {@link #removeSource(int)} with
* {@link com.vonglasow.michael.satstat.data.CellTower#SOURCE_CELL_INFO} as
* its argument. Then it iterates through all entries in {@code cells} and
* updates each entry that is of type {@link android.telephony.CellInfoLte}
* by calling {@link #update(CellInfoLte)}, passing that entry as the
* argument.
*/
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
public void updateAll(List<CellInfo> cells) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1)
return;
this.removeSource(CellTower.SOURCE_CELL_INFO);
if (cells == null)
return;
for (CellInfo cell : cells)
if (cell instanceof CellInfoLte)
this.update((CellInfoLte) cell);
}
java类android.telephony.CellInfoLte的实例源码
CellTowerListLte.java 文件源码
项目:satstat
阅读 18
收藏 0
点赞 0
评论 0
CellInfoLteSubject.java 文件源码
项目:truth-android
阅读 18
收藏 0
点赞 0
评论 0
private CellInfoLteSubject(FailureStrategy failureStrategy, CellInfoLte subject) {
super(failureStrategy, subject);
}
RadioInfo.java 文件源码
项目:CellularSignal
阅读 21
收藏 0
点赞 0
评论 0
@Override
public void onCellInfoChanged(List<CellInfo> cellInfoList) {
super.onCellInfoChanged(cellInfoList);
if (cellInfoList == null) {
//Log.e(Tag,"onCellInfoChanged is null");
return;
}
//Log.e(Tag,"onCellInfoChanged 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();
}
}
((MainActivity)mcontext).mSectionsPagerAdapter.notifyDataSetChanged();
}
RadioInfo.java 文件源码
项目:CellularSignal
阅读 18
收藏 0
点赞 0
评论 0
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();
}
}
}
CellInfoLteAssert.java 文件源码
项目:assertj-android
阅读 17
收藏 0
点赞 0
评论 0
public CellInfoLteAssert(CellInfoLte actual) {
super(actual, CellInfoLteAssert.class);
}