diff options
author | Wink Saville <wink@google.com> | 2010-02-13 07:56:20 -0800 |
---|---|---|
committer | Wink Saville <wink@google.com> | 2010-02-13 07:56:20 -0800 |
commit | 7d97ff10c7555d6b80dc5e6925f066fa8df8258c (patch) | |
tree | fc0ed3f450570a6d9eee33fffa145769295f8321 /telephony/java | |
parent | 19bc31c32d75ebebacd85cac2cf4c31108329613 (diff) | |
download | frameworks_base-7d97ff10c7555d6b80dc5e6925f066fa8df8258c.zip frameworks_base-7d97ff10c7555d6b80dc5e6925f066fa8df8258c.tar.gz frameworks_base-7d97ff10c7555d6b80dc5e6925f066fa8df8258c.tar.bz2 |
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
Diffstat (limited to 'telephony/java')
-rw-r--r-- | telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java b/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java index 425682a..1fb3432 100644 --- a/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java +++ b/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java @@ -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"); } } |