LTE signal ASU level always 97

强颜欢笑 提交于 2019-12-11 09:54:20

问题


I am capturing the RSSI values of LTE signals using the below code:

cInfoList = telephony_manager.getAllCellInfo()
for (CellInfo info : cInfoList){
    if (info instanceof CellInfoLte) {
        CellSignalStrengthLte signalstrength_lte = ((CellInfoLte) info).getCellSignalStrength();
        displayAsu.setText(signalstrength_lte.getAsuLevel() + "");
        displayDbm.setText(signalstrength_lte.getDbm() + "");
    }
}

(*note: I just simplified my code: for-loop doesn't override text fields.)

In one phone (LG G4) I am getting meaningful vales: Asu_level=32, dbm=-108

But in another phone (Samsung Galaxy S6) I am getting invalid values: Asu_level=97, dbm=1022

In Samsung phone's Settings->AboutPhone->Status->SignalStrength I see -107dBm 33 asu (which make sense)

LG G4: Android 5.1, API 22 and Samsung Galaxy S6: Android 5.0.2, API 21

Why does the same code show different behaviors (Asu levels) on different phones?


回答1:


The S6 appears to put corrupted signal level values in its CellInfoLte objects (and unset levels in its CellInfoCdma objects). https://github.com/Tombarr/Signal-Strength-Detector is an app which uses reflection to dump out a plethora of signal level related data. On my S6, I can see that SignalStrength (which is the parameter to the PhoneStateListener.onSignalStrengthsChanged callback) includes sane looking mCdmaDbm/mLteRsrp values. It's obviously less convenient and presumably more overhead to create a TelephonyManager listener but it looks like that's what it takes on this device :-/



来源:https://stackoverflow.com/questions/34800290/lte-signal-asu-level-always-97

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!