diff options
author | Alex Yakavenka <ayakav@codeaurora.org> | 2010-09-28 17:21:58 -0700 |
---|---|---|
committer | Alex Yakavenka <ayakav@codeaurora.org> | 2010-09-28 17:21:58 -0700 |
commit | 9a8e567d2a801d36842e611c1ec7d73c71fffd8f (patch) | |
tree | e44748455469d46bef78f487563dd3dc29c60413 /telephony | |
parent | 7d9c73fb6f6f79f7f92b77482a0edbd7b89f2564 (diff) | |
download | frameworks_base-9a8e567d2a801d36842e611c1ec7d73c71fffd8f.zip frameworks_base-9a8e567d2a801d36842e611c1ec7d73c71fffd8f.tar.gz frameworks_base-9a8e567d2a801d36842e611c1ec7d73c71fffd8f.tar.bz2 |
Telephony: Fix radio state printing
Decode new radio state before printing its value
Change-Id: Ib6d47fd412e85a7799fe56a49d29af7531de8674
Diffstat (limited to 'telephony')
-rw-r--r-- | telephony/java/com/android/internal/telephony/RIL.java | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/telephony/java/com/android/internal/telephony/RIL.java b/telephony/java/com/android/internal/telephony/RIL.java index 569ac5c..a9a4be2 100644 --- a/telephony/java/com/android/internal/telephony/RIL.java +++ b/telephony/java/com/android/internal/telephony/RIL.java @@ -1961,26 +1961,30 @@ public final class RIL extends BaseCommands implements CommandsInterface { sendScreenState(true); } - private void setRadioStateFromRILInt(int state) { - RadioState newState; + private RadioState getRadioStateFromInt(int stateInt) { + RadioState state; /* RIL_RadioState ril.h */ - switch(state) { - case 0: newState = RadioState.RADIO_OFF; break; - case 1: newState = RadioState.RADIO_UNAVAILABLE; break; - case 2: newState = RadioState.SIM_NOT_READY; break; - case 3: newState = RadioState.SIM_LOCKED_OR_ABSENT; break; - case 4: newState = RadioState.SIM_READY; break; - case 5: newState = RadioState.RUIM_NOT_READY; break; - case 6: newState = RadioState.RUIM_READY; break; - case 7: newState = RadioState.RUIM_LOCKED_OR_ABSENT; break; - case 8: newState = RadioState.NV_NOT_READY; break; - case 9: newState = RadioState.NV_READY; break; + switch(stateInt) { + case 0: state = RadioState.RADIO_OFF; break; + case 1: state = RadioState.RADIO_UNAVAILABLE; break; + case 2: state = RadioState.SIM_NOT_READY; break; + case 3: state = RadioState.SIM_LOCKED_OR_ABSENT; break; + case 4: state = RadioState.SIM_READY; break; + case 5: state = RadioState.RUIM_NOT_READY; break; + case 6: state = RadioState.RUIM_READY; break; + case 7: state = RadioState.RUIM_LOCKED_OR_ABSENT; break; + case 8: state = RadioState.NV_NOT_READY; break; + case 9: state = RadioState.NV_READY; break; default: throw new RuntimeException( - "Unrecognized RIL_RadioState: " +state); + "Unrecognized RIL_RadioState: " + stateInt); } + return state; + } + + private void switchToRadioState(RadioState newState) { if (mInitialRadioStateChange) { if (newState.isOn()) { @@ -2361,9 +2365,10 @@ public final class RIL extends BaseCommands implements CommandsInterface { switch(response) { case RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED: /* has bonus radio state int */ - setRadioStateFromRILInt(p.readInt()); + RadioState newState = getRadioStateFromInt(p.readInt()); + if (RILJ_LOGD) unsljLogMore(response, newState.toString()); - if (RILJ_LOGD) unsljLogMore(response, mState.toString()); + switchToRadioState(newState); break; case RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED: if (RILJ_LOGD) unsljLog(response); |