I cannot explain why it is happening. I have some theories, but you have similar ones.
While you sort out the reason, you can deal with issue pragmatically. You know that sometimes even though you are getting a GSM SignalStrength
in your callback, sometimes on some devices you get a CDMA CellLocation
from TelephonyManager
and write your code to handle that case using instanceOf
instead of relying on .isGSM()
from the SignalStrength
.
CellLocation cellLoc = tm.getCellLocation();
if(cellLoc instanceof GsmCellLocation) {
GCellLoc = (GsmCellLocation) cellLoc;
// do work
}