LibPhoneStateListener.java 文件源码

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

项目:android-QoS 作者:
@TargetApi(17) @Override
public void onCellInfoChanged(List<CellInfo> cellinfos) {
    super.onCellInfoChanged(cellinfos);
    try {
        if (!owner.isMMCActiveOrRunning())
            return;
        if (tmLastCellInfoUpdate + 60000 > System.currentTimeMillis() && cellinfos != null && cellinfos.size() > 0 && cellinfos.get(0).toString().equals(lastCellInfoString))
            return;
        if (cellinfos != null && cellinfos.size() > 0)
            lastCellInfoString = cellinfos.get(0).toString();
        else
            lastCellInfoString = "";    
        tmLastCellInfoUpdate = System.currentTimeMillis();

        if (mPhoneState.getNetworkType() == mPhoneState.NETWORK_NEWTYPE_LTE)
        {
            String neighbors = owner.getCellHistory().updateLteNeighborHistory(cellinfos);
            if (neighbors != null)
            {
                owner.getIntentDispatcher().updateLTEIdentity (neighbors);
                owner.getReportManager().setNeighbors(neighbors);
            }

        }

        if (cellinfos != null && cellinfos.size() > 0 && cellinfos.get(0) != null)
            for (int i=0; i<cellinfos.size(); i++)
            {
                //MMCLogger.logToFile(MMCLogger.Level.DEBUG, TAG, "onCellInfoChanged", "cellinfos["+i+"]: " + cellinfos.get(i).toString());
                if (mPhoneState.getNetworkType() == mPhoneState.NETWORK_NEWTYPE_LTE)
                {
                    if (cellinfos.get(i) instanceof CellInfoLte)
                    {
                        CellIdentityLte cellIDLte = ((CellInfoLte)cellinfos.get(i)).getCellIdentity();
                        //MMCLogger.logToFile(MMCLogger.Level.DEBUG, TAG, "onCellInfoChanged", "Reflected: " + listCellInfoFields(cellIDLte));
                    }
                }
            }
        //else
        //  MMCLogger.logToFile(MMCLogger.Level.ERROR, TAG, "onCellInfoChanged", "cellinfos: null");

    } catch (Exception intEx){
        LoggerUtil.logToFile(LoggerUtil.Level.ERROR, TAG, "onCellInfoChanged", "InterruptedException: " + intEx.getMessage());
    } 
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号