Always assume evdoXxxx signal strength values are correct.

This solves a race condition between the network type changing and
a signal strength changing. This could cause StatusBarPolicy to see
the -1 values for the evdo strength parameters and hence 0 bars would
be displayed.

Bug: 2419251
Change-Id: Iba0bdbd2023b6a5e49fc1f82c997ec3219158286
This commit is contained in:
Wink Saville
2010-02-13 07:56:20 -08:00
parent 19bc31c32d
commit 7d97ff10c7

View File

@@ -1170,32 +1170,23 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
} else {
int[] ints = (int[])ar.result;
int offset = 2;
int cdmaDbm = (ints[offset] > 0) ? -ints[offset] : -120;
int cdmaEcio = (ints[offset+1] > 0) ? -ints[offset+1] : -160;
int evdoRssi = (ints[offset+2] > 0) ? -ints[offset+2] : -120;
int evdoEcio = (ints[offset+3] > 0) ? -ints[offset+3] : -1;
int evdoSnr = ((ints[offset+4] > 0) && (ints[offset+4] <= 8)) ? ints[offset+4] : -1;
int evdoRssi = -1;
int evdoEcio = -1;
int evdoSnr = -1;
if ((networkType == ServiceState.RADIO_TECHNOLOGY_EVDO_0)
|| (networkType == ServiceState.RADIO_TECHNOLOGY_EVDO_A)) {
evdoRssi = (ints[offset+2] > 0) ? -ints[offset+2] : -120;
evdoEcio = (ints[offset+3] > 0) ? -ints[offset+3] : -1;
evdoSnr = ((ints[offset+4] > 0) && (ints[offset+4] <= 8)) ? ints[offset+4] : -1;
}
//log(String.format("onSignalStrengthResult cdmaDbm=%d cdmaEcio=%d evdoRssi=%d evdoEcio=%d evdoSnr=%d",
// cdmaDbm, cdmaEcio, evdoRssi, evdoEcio, evdoSnr));
mSignalStrength = new SignalStrength(99, -1, cdmaDbm, cdmaEcio,
evdoRssi, evdoEcio, evdoSnr, false);
}
if (!mSignalStrength.equals(oldSignalStrength)) {
try { // This takes care of delayed EVENT_POLL_SIGNAL_STRENGTH (scheduled after
// POLL_PERIOD_MILLIS) during Radio Technology Change)
phone.notifySignalStrength();
} catch (NullPointerException ex) {
log("onSignalStrengthResult() Phone already destroyed: " + ex
+ "SignalStrength not notified");
}
try {
phone.notifySignalStrength();
} catch (NullPointerException ex) {
log("onSignalStrengthResult() Phone already destroyed: " + ex
+ "SignalStrength not notified");
}
}