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

Commit 5c182fdf authored by Shishir Agrawal's avatar Shishir Agrawal Committed by Android (Google) Code Review
Browse files

Merge "ServiceStateTracker: Only call updatePhoneObject when the phone is...

Merge "ServiceStateTracker: Only call updatePhoneObject when the phone is registered." into lmp-mr1-dev
parents 8698a61c 14ad8ce7
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import android.os.Registrant;
import android.os.RegistrantList;
import android.os.SystemClock;
import android.telephony.CellInfo;
import android.telephony.Rlog;
import android.telephony.ServiceState;
import android.telephony.SignalStrength;
import android.telephony.TelephonyManager;
@@ -48,6 +49,7 @@ import com.android.internal.telephony.uicc.UiccController;
 * {@hide}
 */
public abstract class ServiceStateTracker extends Handler {
    private static final String LOG_TAG = "SST";
    protected  static final boolean DBG = true;
    protected static final boolean VDBG = false;

@@ -294,6 +296,13 @@ public abstract class ServiceStateTracker extends Handler {
    protected void updatePhoneObject() {
        if (mPhoneBase.getContext().getResources().
                getBoolean(com.android.internal.R.bool.config_switch_phone_on_voice_reg_state_change)) {
            // If the phone is not registered on a network, no need to update.
            boolean isRegistered = mSS.getVoiceRegState() == ServiceState.STATE_IN_SERVICE ||
                    mSS.getVoiceRegState() == ServiceState.STATE_EMERGENCY_ONLY;
            if (!isRegistered) {
                Rlog.d(LOG_TAG, "updatePhoneObject: Ignore update");
                return;
            }
            mPhoneBase.updatePhoneObject(mSS.getRilVoiceRadioTechnology());
        }
    }
+9 −1
Original line number Diff line number Diff line
@@ -669,9 +669,16 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker {

    @Override
    protected void updatePhoneObject() {
        int voiceRat = mSS.getRilVoiceRadioTechnology();
        if (mPhone.getContext().getResources().
                getBoolean(com.android.internal.R.bool.config_switch_phone_on_voice_reg_state_change)) {
            // If the phone is not registered on a network, no need to update.
            boolean isRegistered = mSS.getVoiceRegState() == ServiceState.STATE_IN_SERVICE ||
                    mSS.getVoiceRegState() == ServiceState.STATE_EMERGENCY_ONLY;
            if (!isRegistered) {
                Rlog.d(LOG_TAG, "updatePhoneObject: Ignore update");
                return;
            }

            // For CDMA-LTE phone don't update phone to GSM
            // if replacement RAT is unknown
            // If there is a  real need to switch to LTE, then it will be done via
@@ -681,6 +688,7 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker {
                    com.android.internal.R.integer.config_volte_replacement_rat);
            Rlog.d(LOG_TAG, "updatePhoneObject: volteReplacementRat=" + volteReplacementRat);

            int voiceRat = mSS.getRilVoiceRadioTechnology();
            if (voiceRat == ServiceState.RIL_RADIO_TECHNOLOGY_LTE &&
                    volteReplacementRat == ServiceState.RIL_RADIO_TECHNOLOGY_UNKNOWN) {
                voiceRat = ServiceState.RIL_RADIO_TECHNOLOGY_1xRTT;