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

Commit 4241923b authored by Alex Yakavenka's avatar Alex Yakavenka Committed by Shareef Ali
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

Conflicts:
	src/java/com/android/internal/telephony/uicc/IccCardProxy.java

Change-Id: I04ee067cfb5f6517298458667500db14aaefc810
parent 2be66cb5
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -153,6 +153,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" +
@@ -169,6 +171,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;
                }
            }
@@ -179,6 +183,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;
        }

+19 −1
Original line number Diff line number Diff line
@@ -140,13 +140,31 @@ 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.