Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4df84a42 authored by Alex Yakavenka's avatar Alex Yakavenka Committed by Linux Build Service Account
Browse files

Telephony: Guess radio tech

If RIL returns radio_tech_unknown IccCardProxy
needs to guess radio tech family.
It will do so based on present uicc applications.

Make sure that all pathes update IccCardProxy
radio tech, since it has its own logic for determining
app type, which might change even when PhoneProxy
ignores the change
(An example of this would be umts->unknown->umts change)
CRs-Fixed: 460777

Change-Id: I3027021350598dd5edd419ac6ce0857f1a0e0a11
parent bd9a68c5
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -149,6 +149,8 @@ public class PhoneProxy extends Handler implements Phone {
                    logd("LTE ON CDMA property is set. Use CDMA Phone" +
                            " newVoiceRadioTech = " + newVoiceRadioTech +
                            " Active Phone = " + mActivePhone.getPhoneName());
                    // IccCardProxy needs to be kept in sync
                    mIccCardProxy.setVoiceRadioTech(newVoiceRadioTech);
                    return;
                } else {
                    logd("LTE ON CDMA property is set. Switch to CDMALTEPhone" +
@@ -165,6 +167,8 @@ public class PhoneProxy extends Handler implements Phone {
                    logd("Ignoring voice radio technology changed message." +
                            " newVoiceRadioTech = " + newVoiceRadioTech +
                            " Active Phone = " + mActivePhone.getPhoneName());
                    // IccCardProxy needs to be kept in sync
                    mIccCardProxy.setVoiceRadioTech(newVoiceRadioTech);
                    return;
                }
            }
@@ -175,6 +179,8 @@ public class PhoneProxy extends Handler implements Phone {
            // delete the phone without anything to replace it with!
            logd("Ignoring voice radio technology changed message. newVoiceRadioTech = Unknown."
                    + " Active Phone = " + mActivePhone.getPhoneName());
            // IccCardProxy, though, needs to know even if radio tech is unknown
            mIccCardProxy.setVoiceRadioTech(newVoiceRadioTech);
            return;
        }

+20 −1
Original line number Diff line number Diff line
@@ -140,13 +140,32 @@ public class IccCardProxy extends Handler implements IccCard {
            }
            if (ServiceState.isGsm(radioTech)) {
                mCurrentAppType = UiccController.APP_FAM_3GPP;
            } else {
            } else if (ServiceState.isCdma(radioTech)){
                mCurrentAppType = UiccController.APP_FAM_3GPP2;
            } else {
                // If reported radio tech is unknown - we will have to guess
                mCurrentAppType = guessRadioTech();
                if (DBG) {
                    log("Radio tech is unknown. Guessed radio tech family is " + mCurrentAppType);
                }
            }
            updateQuietMode();
        }
    }

    /**
     * This function guesses radio tech family based on available uicc applications
     */
    private int guessRadioTech() {
        UiccCardApplication app =
                mUiccController.getUiccCardApplication(UiccController.APP_FAM_3GPP);
        if (app != null) {
            return UiccController.APP_FAM_3GPP;
        } else {
            return UiccController.APP_FAM_3GPP2;
        }
    }

    /**
     * In case of 3gpp2 we need to find out if subscription used is coming from
     * NV in which case we shouldn't broadcast any sim states changes.