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

Commit 0538336a authored by Linux Build Service Account's avatar Linux Build Service Account
Browse files

Merge 6a7175ed on remote branch

Change-Id: Ie5b55be3d081ea93fc1c8938dcbc5fce52739de4
parents a4dec372 6a7175ed
Loading
Loading
Loading
Loading
+37 −7
Original line number Diff line number Diff line
@@ -116,6 +116,9 @@ public class GsmCdmaPhone extends Phone {
    /** List of Registrants to receive Supplementary Service Notifications. */
    private RegistrantList mSsnRegistrants = new RegistrantList();

    // the state value for VoltPreferred (0->off, 1->on)
    private static final int VOLTE_PREFERRED_ON = 1;

    //CDMA
    // Default Emergency Callback Mode exit timer
    private static final int DEFAULT_ECM_EXIT_TIMER_VALUE = 300000;
@@ -191,6 +194,7 @@ public class GsmCdmaPhone extends Phone {
    private int mRilVersion;
    private boolean mBroadcastEmergencyCallStateChanges = false;

    private int mCdmaRoamingType = CarrierConfigManager.CDMA_ROAMING_MODE_RADIO_DEFAULT;
    // Constructors

    public GsmCdmaPhone(Context context, CommandsInterface ci, PhoneNotifier notifier, int phoneId,
@@ -220,9 +224,12 @@ public class GsmCdmaPhone extends Phone {
        public void onReceive(Context context, Intent intent) {
            Rlog.d(LOG_TAG, "mBroadcastReceiver: action " + intent.getAction());
            if (intent.getAction().equals(CarrierConfigManager.ACTION_CARRIER_CONFIG_CHANGED)) {
                int phoneId = intent.getIntExtra(PhoneConstants.PHONE_KEY, mPhoneId);
                if (phoneId == mPhoneId) {
                    sendMessage(obtainMessage(EVENT_CARRIER_CONFIG_CHANGED));
                }
            }
        }
    };

    private void initOnce(CommandsInterface ci) {
@@ -1092,6 +1099,20 @@ public class GsmCdmaPhone extends Phone {

        boolean useImsForUt = imsPhone != null && imsPhone.isUtEnabled();

        // when Volte preferred is set to "yes"(which is the default setting),
        // MO calls would be done over IMS (per existing MO procedures).
        // The VoLTE Preferred settings shall not change the Emergency/911 call logic.
        // Volte preferred setting is applicable for both VT and VoLTE calls.
        // Volte prefeered setting is a global ims setting that determines the call
        // path for all IMS calls (eg. volte/vt).
        boolean useImsPrefer = mContext.getResources().getBoolean(
                com.android.internal.R.bool.config_volte_preferred)
                && (Settings.Global.getInt(mContext.getContentResolver(),
                Settings.Global.VOLTE_PREFERRED_ON, VOLTE_PREFERRED_ON) == VOLTE_PREFERRED_ON)
                && (imsPhone != null) && !(isEmergency || isUt)
                && ImsManager.isNonTtyOrTtyOnVolteEnabled(mContext)
                && (imsPhone.getServiceState().getState() != ServiceState.STATE_POWER_OFF);

        if (DBG) {
            logd("imsUseEnabled=" + imsUseEnabled
                    + ", useImsForEmergency=" + useImsForEmergency
@@ -1105,12 +1126,13 @@ public class GsmCdmaPhone extends Phone {
                    + ", imsPhone.isVideoEnabled()="
                    + ((imsPhone != null) ? imsPhone.isVideoEnabled() : "N/A")
                    + ", imsPhone.getServiceState().getState()="
                    + ((imsPhone != null) ? imsPhone.getServiceState().getState() : "N/A"));
                    + ((imsPhone != null) ? imsPhone.getServiceState().getState() : "N/A")
                    + ", useImsPrefer=" + useImsPrefer);
        }

        Phone.checkWfcWifiOnlyModeBeforeDial(mImsPhone, mContext);

        if ((imsUseEnabled && (!isUt || useImsForUt)) || useImsForEmergency) {
        if ((imsUseEnabled && (!isUt || useImsForUt)) || useImsForEmergency || useImsPrefer) {
            try {
                if (DBG) logd("Trying IMS PS call");
                return imsPhone.dial(dialString, uusInfo, videoState, intentExtras);
@@ -2130,7 +2152,8 @@ public class GsmCdmaPhone extends Phone {
                // Changing the cdma roaming settings based carrier config.
                if (b != null) {
                    int config_cdma_roaming_mode = b.getInt(
                            CarrierConfigManager.KEY_CDMA_ROAMING_MODE_INT);
                            CarrierConfigManager.KEY_CDMA_ROAMING_MODE_INT,
                            CarrierConfigManager.CDMA_ROAMING_MODE_RADIO_DEFAULT);
                    int current_cdma_roaming_mode =
                            Settings.Global.getInt(getContext().getContentResolver(),
                            Settings.Global.CDMA_ROAMING_MODE,
@@ -2144,16 +2167,23 @@ public class GsmCdmaPhone extends Phone {
                        case CarrierConfigManager.CDMA_ROAMING_MODE_ANY:
                            logd("cdma_roaming_mode is going to changed to "
                                    + config_cdma_roaming_mode);
                            logd("mCdmaRoamingType is "+mCdmaRoamingType);
                            if (isPhoneTypeCdma() && mCdmaRoamingType != config_cdma_roaming_mode) {
                                mCdmaRoamingType = config_cdma_roaming_mode;
                                setCdmaRoamingPreference(config_cdma_roaming_mode,
                                        obtainMessage(EVENT_SET_ROAMING_PREFERENCE_DONE));
                            }
                            break;

                        // When carrier's setting is turn off, change the cdma_roaming_mode to the
                        // previous user's setting
                        case CarrierConfigManager.CDMA_ROAMING_MODE_RADIO_DEFAULT:
                            if (current_cdma_roaming_mode != config_cdma_roaming_mode) {
                            if (isPhoneTypeCdma() &&
                                    current_cdma_roaming_mode != config_cdma_roaming_mode &&
                                    mCdmaRoamingType != current_cdma_roaming_mode) {
                                logd("cdma_roaming_mode is going to changed to "
                                        + current_cdma_roaming_mode);
                                mCdmaRoamingType = current_cdma_roaming_mode;
                                setCdmaRoamingPreference(current_cdma_roaming_mode,
                                        obtainMessage(EVENT_SET_ROAMING_PREFERENCE_DONE));
                            }
+28 −4
Original line number Diff line number Diff line
@@ -2110,8 +2110,9 @@ public class ServiceStateTracker extends Handler {
            String plmn = null;
            boolean showPlmn = false;
            int rule = (iccRecords != null) ? iccRecords.getDisplayRule(mSS.getOperatorNumeric()) : 0;
            if (mSS.getVoiceRegState() == ServiceState.STATE_OUT_OF_SERVICE
                    || mSS.getVoiceRegState() == ServiceState.STATE_EMERGENCY_ONLY) {
            int combinedRegState = getCombinedRegState();
            if (combinedRegState == ServiceState.STATE_OUT_OF_SERVICE
                    || combinedRegState == ServiceState.STATE_EMERGENCY_ONLY) {
                showPlmn = true;
                if (mEmergencyOnly) {
                    // No service but emergency call allowed
@@ -2124,7 +2125,7 @@ public class ServiceStateTracker extends Handler {
                }
                if (DBG) log("updateSpnDisplay: radio is on but out " +
                        "of service, set plmn='" + plmn + "'");
            } else if (mSS.getVoiceRegState() == ServiceState.STATE_IN_SERVICE) {
            } else if (combinedRegState == ServiceState.STATE_IN_SERVICE) {
                // In either home or roaming service
                plmn = mSS.getOperatorAlphaLong();
                showPlmn = !TextUtils.isEmpty(plmn) &&
@@ -2242,6 +2243,15 @@ public class ServiceStateTracker extends Handler {
                subId = subIds[0];
            }

            int combinedRegState = getCombinedRegState();
            if (combinedRegState == ServiceState.STATE_OUT_OF_SERVICE) {
                plmn = Resources.getSystem().getText(com.android.internal.
                    R.string.lockscreen_carrier_default).toString();
                if (DBG) log("updateSpnDisplay: radio is on but out " +
                    "of service, set plmn='" + plmn + "'");
            }


            if (mSubId != subId || !TextUtils.equals(plmn, mCurPlmn)) {
                // Allow A blank plmn, "" to set showPlmn to true. Previously, we
                // would set showPlmn to true only if plmn was not empty, i.e. was not
@@ -4869,6 +4879,20 @@ public class ServiceStateTracker extends Handler {
        return isInNetwork(b, network, CarrierConfigManager.KEY_CDMA_NONROAMING_NETWORKS_STRING_ARRAY);
    }

   /**
     * Consider dataRegState if voiceRegState is OOS to determine SPN to be displayed
     */
    protected int getCombinedRegState() {
        int regState = mSS.getVoiceRegState();
        int dataRegState = mSS.getDataRegState();
        if ((regState == ServiceState.STATE_OUT_OF_SERVICE)
                && (dataRegState == ServiceState.STATE_IN_SERVICE)) {
                    log("getCombinedRegState: return STATE_IN_SERVICE as Data is in service");
                     regState = dataRegState;
        }
        return regState;
    }

  /** Check if the device is shutting down. */
    public boolean isDeviceShuttingDown() {
        return mDeviceShuttingDown;
+1 −1
Original line number Diff line number Diff line
@@ -266,7 +266,7 @@ public class SmsMessage extends SmsMessageBase {

            // Second byte is the MSG_LEN, length of the message
            // See 3GPP2 C.S0023 3.4.27
            int size = data[1];
            int size = data[1] & 0xFF;

            // Note: Data may include trailing FF's.  That's OK; message
            // should still parse correctly.
+6 −0
Original line number Diff line number Diff line
@@ -1159,6 +1159,7 @@ public class ImsPhone extends ImsPhoneBase {
                    if (infos[i].mServiceClass == (SERVICE_CLASS_DATA_SYNC +
                                SERVICE_CLASS_PACKET)) {
                        setVideoCallForwardingPreference(infos[i].mStatus == 1);
                        notifyCallForwardingIndicator();
                    } else if (r != null) {
                        setVoiceCallForwardingFlag(r, 1, (infos[i].mStatus == 1),
                            infos[i].mNumber);
@@ -1622,6 +1623,11 @@ public class ImsPhone extends ImsPhoneBase {
        mDefaultPhone.setBroadcastEmergencyCallStateChanges(broadcast);
    }

    @Override
    public void notifyCallForwardingIndicator() {
        mDefaultPhone.notifyCallForwardingIndicator();
    }

    @VisibleForTesting
    public PowerManager.WakeLock getWakeLock() {
        return mWakeLock;
+1 −0
Original line number Diff line number Diff line
@@ -1056,6 +1056,7 @@ public final class ImsPhoneMmiCode extends Handler implements MmiCode {
                        if(siToServiceClass(mSib) == (SERVICE_CLASS_PACKET
                                    + SERVICE_CLASS_DATA_SYNC)) {
                            mPhone.setVideoCallForwardingPreference(cffEnabled);
                            mPhone.notifyCallForwardingIndicator();
                        } else {
                            mPhone.setVoiceCallForwardingFlag(1, cffEnabled, mDialingNumber);
                        }
Loading