getPsc()使用GsmCellLocation总是返回-1 [英] getPsc() using GsmCellLocation always returns -1

查看:927
本文介绍了getPsc()使用GsmCellLocation总是返回-1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我成功地获得 GsmCellLocation 和相关的CID和LAC信息,但服务小区的PSC(主扰code)总是与初始化回来值-1。
任何人都能够得到服务小区的真正价值PSC?

I'm successfully getting GsmCellLocation and related cid and lac information but the PSC (primary scrambling code) of the serving cell is always coming back with the initialized value -1. Anyone able to get the real PSC value of the serving cell?

telephonyManager = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
GsmCellLocation cellLocation = (GsmCellLocation) telephonyManager.getCellLocation();
psc = cellLocation.getPsc();
Log.d(TAG, "PSC = " + psc);

我拥有所有权限必须的。我的邻居列表返回空以及但这并不是目前关注的问题。

I have all the permissions necessary. My neighbor list returns empty as well but that's not a concern at the moment.

推荐答案

PSC仅适用于UMTS网络。结果
检查网络类型<一个href=\"http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkType%28%29\"相对=nofollow> getNetworkType 如果是 NETWORK_TYPE_UMTS ,而不是 NETWORK_TYPE_EDGE

PSC is available only on UMTS network.
Check network type getNetworkType if it's NETWORK_TYPE_UMTS and not NETWORK_TYPE_EDGE

这篇关于getPsc()使用GsmCellLocation总是返回-1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆