Android开发中真机测试GsmCellLocation对象获取为空?

真机测试中GsmCellLocation对象获取为空

权限已经添加

SCell cell = new SCell();
    TelephonyManager mTelephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
    //返回值MCC + MNC
    String operator = mTelephonyManager.getNetworkOperator();
    int mcc = Integer.parseInt(operator.substring(0, 3));
    int mnc = Integer.parseInt(operator.substring(3));

    // 中国移动和中国联通获取LAC、CID的方式
    GsmCellLocation location = (GsmCellLocation) mTelephonyManager.getCellLocation();
    if (location != null) {
        Log.d("YES", "************OK!!************");
    }else if(location == null){
        Log.d("NO", "************NULL!!************");
    }

    int lac = location.getLac();
    int cellId = location.getCid();

以下是Android Studio的报错:
location为空。
对了,,在模拟器中运行是没有这个问题的。。
如果有路过的高手了解这个问题恳请告知我问题所在,谢谢!!
图片说明

https://www.cnblogs.com/umlzhang/p/5893136.html