Utilities.java 文件源码

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

项目:RadioControl 作者:
public static int getCellStatus(Context c){
    int z = 0;
    try {
        TelephonyManager tm = (TelephonyManager) c.getSystemService(Context.TELEPHONY_SERVICE);
        List<CellInfo> cellInfoList = tm.getAllCellInfo();
        //This means cell is off
        if (cellInfoList.isEmpty()) {
            z = 1;
        }
        return z;
    } catch(SecurityException e){
        Log.e("RadioControl","Unable to get Location Permission",e);
    }
    return z;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号