CellIdPre17API.java 文件源码

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

项目:pyneo-wirelesslocation 作者:
public CellIdPre17API(TelephonyManager telephonyManager, CellLocation cellLocation, List<NeighboringCellInfo> neighboringCellInfoList) {
    if (DEBUG) Log.d(TAG, "CellIdPre17API:");
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
        this.fallback_pre17api = true;
    }
    this.cellLocation = cellLocation;
    this.neighboringCellInfoList = neighboringCellInfoList;
    if (cellLocation != null) {
        this.i = -1;
    }
    else {
        this.i = 0;
    }
    String mccmnc = telephonyManager.getNetworkOperator();
    if (mccmnc != null && mccmnc.length() >= 5 && mccmnc.length() <= 6) {
        mcc = Integer.parseInt(mccmnc.substring(0, 3));
        mnc = Integer.parseInt(mccmnc.substring(3));
    }
    else {
        Log.e(TAG, "CellIdPre17API: wrong legnth (5-6) for mccmnc=" + mccmnc);
    }
    type = telephonyManager.getNetworkType();
    if (DEBUG) Log.d(TAG, "CellIdPre17API: mcc=" + mcc + ", mnc=" + mnc + ", type=" + type + " cellLocation=" + cellLocation + ", neighboringCellInfoList=" + neighboringCellInfoList);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号