diff options
Diffstat (limited to 'src/java/com/android/internal/telephony/SamsungQualcommRIL.java')
-rw-r--r-- | src/java/com/android/internal/telephony/SamsungQualcommRIL.java | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/java/com/android/internal/telephony/SamsungQualcommRIL.java b/src/java/com/android/internal/telephony/SamsungQualcommRIL.java index ad6f90d..997cf01 100644 --- a/src/java/com/android/internal/telephony/SamsungQualcommRIL.java +++ b/src/java/com/android/internal/telephony/SamsungQualcommRIL.java @@ -62,6 +62,7 @@ public class SamsungQualcommRIL extends RIL implements CommandsInterface { public static final long SEND_SMS_TIMEOUT_IN_MS = 30000; private String homeOperator= SystemProperties.get("ro.cdma.home.operator.numeric"); private String operator= SystemProperties.get("ro.cdma.home.operator.alpha"); + private boolean oldRilState = needsOldRilFeature("exynos4RadioState"); public SamsungQualcommRIL(Context context, int networkMode, int cdmaSubscription) { super(context, networkMode, cdmaSubscription); @@ -185,6 +186,40 @@ public class SamsungQualcommRIL extends RIL implements CommandsInterface { } @Override + protected RadioState getRadioStateFromInt(int stateInt) { + if(!oldRilState) + super.getRadioStateFromInt(stateInt); + RadioState state; + + /* RIL_RadioState ril.h */ + switch(stateInt) { + case 0: state = RadioState.RADIO_OFF; break; + case 1: + case 2: state = RadioState.RADIO_UNAVAILABLE; break; + case 4: + // When SIM is PIN-unlocked, RIL doesn't respond with RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED. + // We notify the system here. + Log.d(LOG_TAG, "SIM is PIN-unlocked now"); + if (mIccStatusChangedRegistrants != null) { + mIccStatusChangedRegistrants.notifyRegistrants(); + } + case 3: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 13: state = RadioState.RADIO_ON; break; + + default: + throw new RuntimeException( + "Unrecognized RIL_RadioState: " + stateInt); + } + return state; + } + + @Override public void setPhoneType(int phoneType){ super.setPhoneType(phoneType); isGSM = (phoneType != RILConstants.CDMA_PHONE); |