CellTowerListGsm.java 文件源码

java
阅读 24 收藏 0 点赞 0 评论 0

项目:satstat 作者:
/**
 * 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.CellInfoGsm}
 * or {@link android.telephony.CellInfoWcdma} by calling
 * {@link #update(CellInfoGsm)} or {@link #update(CellInfoWcdma)}
 * (depending on type), passing that entry as the argument.
 */
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 CellInfoGsm)
            this.update((CellInfoGsm) cell);
        else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2)
            if (cell instanceof CellInfoWcdma)
                this.update((CellInfoWcdma) cell);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号