/**
* Adds or updates a cell tower.
* <p>
* If the cell tower is already in the list, it is replaced; if not, a new
* entry is created.
* <p>
* This method will set the cell's identity data, its signal strength and
* whether it is the currently serving cell. If the API level is 18 or
* higher, it will also set the generation.
* @return The new or updated entry.
*/
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
public CellTowerCdma update(CellInfoCdma cell) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1)
return null;
CellIdentityCdma cid = cell.getCellIdentity();
CellTowerCdma result = this.get(cid.getSystemId(), cid.getNetworkId(), cid.getBasestationId());
if (result == null) {
result = new CellTowerCdma(cid.getSystemId(), cid.getNetworkId(), cid.getBasestationId());
this.put(result.getText(), result);
}
result.setCellInfo(true);
result.setDbm(cell.getCellSignalStrength().getDbm());
result.setServing(cell.isRegistered());
return result;
}
CellTowerListCdma.java 文件源码
java
阅读 19
收藏 0
点赞 0
评论 0
项目:satstat
作者:
评论列表
文章目录