Merge "Telephony: Fix radio state printing"
This commit is contained in:
@@ -1961,26 +1961,30 @@ public final class RIL extends BaseCommands implements CommandsInterface {
|
|||||||
sendScreenState(true);
|
sendScreenState(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setRadioStateFromRILInt(int state) {
|
private RadioState getRadioStateFromInt(int stateInt) {
|
||||||
RadioState newState;
|
RadioState state;
|
||||||
|
|
||||||
/* RIL_RadioState ril.h */
|
/* RIL_RadioState ril.h */
|
||||||
switch(state) {
|
switch(stateInt) {
|
||||||
case 0: newState = RadioState.RADIO_OFF; break;
|
case 0: state = RadioState.RADIO_OFF; break;
|
||||||
case 1: newState = RadioState.RADIO_UNAVAILABLE; break;
|
case 1: state = RadioState.RADIO_UNAVAILABLE; break;
|
||||||
case 2: newState = RadioState.SIM_NOT_READY; break;
|
case 2: state = RadioState.SIM_NOT_READY; break;
|
||||||
case 3: newState = RadioState.SIM_LOCKED_OR_ABSENT; break;
|
case 3: state = RadioState.SIM_LOCKED_OR_ABSENT; break;
|
||||||
case 4: newState = RadioState.SIM_READY; break;
|
case 4: state = RadioState.SIM_READY; break;
|
||||||
case 5: newState = RadioState.RUIM_NOT_READY; break;
|
case 5: state = RadioState.RUIM_NOT_READY; break;
|
||||||
case 6: newState = RadioState.RUIM_READY; break;
|
case 6: state = RadioState.RUIM_READY; break;
|
||||||
case 7: newState = RadioState.RUIM_LOCKED_OR_ABSENT; break;
|
case 7: state = RadioState.RUIM_LOCKED_OR_ABSENT; break;
|
||||||
case 8: newState = RadioState.NV_NOT_READY; break;
|
case 8: state = RadioState.NV_NOT_READY; break;
|
||||||
case 9: newState = RadioState.NV_READY; break;
|
case 9: state = RadioState.NV_READY; break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw new RuntimeException(
|
throw new RuntimeException(
|
||||||
"Unrecognized RIL_RadioState: " +state);
|
"Unrecognized RIL_RadioState: " + stateInt);
|
||||||
}
|
}
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void switchToRadioState(RadioState newState) {
|
||||||
|
|
||||||
if (mInitialRadioStateChange) {
|
if (mInitialRadioStateChange) {
|
||||||
if (newState.isOn()) {
|
if (newState.isOn()) {
|
||||||
@@ -2361,9 +2365,10 @@ public final class RIL extends BaseCommands implements CommandsInterface {
|
|||||||
switch(response) {
|
switch(response) {
|
||||||
case RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED:
|
case RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED:
|
||||||
/* has bonus radio state int */
|
/* 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;
|
break;
|
||||||
case RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED:
|
case RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED:
|
||||||
if (RILJ_LOGD) unsljLog(response);
|
if (RILJ_LOGD) unsljLog(response);
|
||||||
|
|||||||
Reference in New Issue
Block a user