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

Commit fd5905e1 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Merge 38470175 on remote branch"

parents d3cd3594 89a1f70e
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import android.os.RegistrantList;
import android.os.Registrant;
import android.os.SystemProperties;
import android.telephony.MSimTelephonyManager;
import android.telephony.PhoneNumberUtils;
import android.telephony.PhoneStateListener;
import android.telephony.Rlog;
import android.telephony.ServiceState;
@@ -112,6 +113,8 @@ public class CallManager {
    // save a cached copy of Ims Phone
    private Phone mImsPhone;

    protected String mDialString;

    private boolean mSpeedUpAudioForMtCall = false;

    protected CmHandler mHandler;
@@ -909,6 +912,7 @@ public class CallManager {

        Phone basePhone = getPhoneBase(phone);
        Connection result;
        mDialString = dialString;

        if (VDBG) {
            Rlog.d(LOG_TAG, " dial(" + basePhone + ", "+ dialString + ")");
@@ -952,6 +956,18 @@ public class CallManager {
        return result;
    }

    protected boolean isExplicitCallTransferMMI (String dialString) {
        boolean result = false;
        String newDialString = PhoneNumberUtils.stripSeparators(dialString);
        if ((newDialString != null) && (newDialString.length() == 1)) {
            char ch = newDialString.charAt(0);
            if (ch == '4') {
                result = true;
            }
        }
        return result;
    }

    /**
     * Initiate a new voice connection. This happens asynchronously, so you
     * cannot assume the audio path is connected (or a call index has been
@@ -993,6 +1009,11 @@ public class CallManager {
                && !hasRingingCall
                && ((fgCallState == Call.State.ACTIVE)
                    || (fgCallState == Call.State.IDLE)
                    /*As per 3GPP TS 51.010-1 section 31.13.1.4
                    call should be alowed when the foreground
                    call is in ALERTING state*/
                    || ((fgCallState == Call.State.ALERTING) &&
                            isExplicitCallTransferMMI(mDialString))
                    || (fgCallState == Call.State.DISCONNECTED)));

        if (result == false) {
+1 −0
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ public abstract class CallTracker extends Handler {
    protected static final int EVENT_EXIT_ECM_RESPONSE_CDMA        = 14;
    protected static final int EVENT_CALL_WAITING_INFO_CDMA        = 15;
    protected static final int EVENT_THREE_WAY_DIAL_L2_RESULT_CDMA = 16;
    protected static final int EVENT_CDMA_INFO_REC                 = 17;

    protected void pollCallsWhenSafe() {
        mNeedsPoll = true;
+6 −0
Original line number Diff line number Diff line
@@ -461,6 +461,7 @@ public class ExtCallManager extends CallManager {
        Phone basePhone = getPhoneBase(phone);
        int subscription = phone.getSubscription();
        Connection result;
        mDialString = dialString;

        if (VDBG) {
            Rlog.d(LOG_TAG, " dial(" + basePhone + ", "+ dialString + ")" +
@@ -516,6 +517,11 @@ public class ExtCallManager extends CallManager {
                && !hasRingingCall
                && ((fgCallState == Call.State.ACTIVE)
                    || (fgCallState == Call.State.IDLE)
                    /*As per 3GPP TS 51.010-1 section 31.13.1.4
                    call should be alowed when the foreground
                    call is in ALERTING state*/
                    || ((fgCallState == Call.State.ALERTING) &&
                            isExplicitCallTransferMMI(mDialString))
                    || (fgCallState == Call.State.DISCONNECTED)));

        if (result == false) {
+60 −2
Original line number Diff line number Diff line
@@ -29,7 +29,9 @@ import android.os.AsyncResult;
import android.os.Message;
import android.provider.Telephony.Sms.Intents;
import android.telephony.Rlog;
import android.telephony.TelephonyManager;

import com.android.internal.R;
import com.android.internal.telephony.cdma.CdmaSMSDispatcher;
import com.android.internal.telephony.gsm.GsmSMSDispatcher;
import com.android.internal.telephony.InboundSmsHandler;
@@ -50,6 +52,13 @@ public class ImsSMSDispatcher extends SMSDispatcher {
    private boolean mIms = false;
    private String mImsSmsFormat = SmsConstants.FORMAT_UNKNOWN;

    /**
     * true if MO SMS over IMS is enabled. Default value is true. false for
     * carriers with config_send_sms1x_on_voice_call = true when attached to
     * eHRPD and during active 1x voice call
     */
    private boolean mImsSmsEnabled = true;

    public ImsSMSDispatcher(PhoneBase phone, SmsStorageMonitor storageMonitor,
            SmsUsageMonitor usageMonitor) {
        super(phone, usageMonitor, null);
@@ -349,8 +358,9 @@ public class ImsSMSDispatcher extends SMSDispatcher {
     * @return true if Cdma format should be used for MO SMS, false otherwise.
     */
    private boolean isCdmaMo() {
        if (!isIms()) {
            // IMS is not registered, use Voice technology to determine SMS format.
        if (!isIms() || !shouldSendSmsOverIms()) {
            // Either IMS is not registered or there is an active 1x voice call
            // while on eHRPD, use Voice technology to determine SMS format.
            return (PhoneConstants.PHONE_TYPE_CDMA == mPhone.getPhoneType());
        }
        // IMS is registered with SMS support
@@ -366,4 +376,52 @@ public class ImsSMSDispatcher extends SMSDispatcher {
    private boolean isCdmaFormat(String format) {
        return (mCdmaDispatcher.getFormat().equals(format));
    }

    /**
     * Enables MO SMS over IMS
     *
     * @param enable
     */
    public void enableSendSmsOverIms(boolean enable) {
        mImsSmsEnabled = enable;
    }

    /**
     * Determines whether MO SMS over IMS is currently enabled.
     *
     * @return true if MO SMS over IMS is enabled, false otherwise.
     */
    public boolean isImsSmsEnabled() {
        return mImsSmsEnabled;
    }

    /**
     * Determines whether SMS should be sent over IMS if UE is attached to eHRPD
     * and there is an active voice call
     *
     * @return true if SMS should be sent over IMS based on value in config.xml
     *         or system property false otherwise
     */
    public boolean shouldSendSmsOverIms() {
        boolean sendSmsOn1x = mContext.getResources().getBoolean(
                com.android.internal.R.bool.config_send_sms1x_on_voice_call);
        int currentCallState = mTelephonyManager.getCallState();
        int currentVoiceNetwork = mTelephonyManager.getVoiceNetworkType();
        int currentDataNetwork = mTelephonyManager.getDataNetworkType();

        Rlog.d(TAG, "data = " + currentDataNetwork + " voice = " + currentVoiceNetwork
                + " call state = " + currentCallState);

        if (sendSmsOn1x) {
            // The UE shall use 1xRTT for SMS if the UE is attached to an eHRPD
            // network and there is an active 1xRTT voice call.
            if (currentDataNetwork == TelephonyManager.NETWORK_TYPE_EHRPD
                    && currentVoiceNetwork == TelephonyManager.NETWORK_TYPE_1xRTT
                    && currentCallState != mTelephonyManager.CALL_STATE_IDLE) {
                enableSendSmsOverIms(false);
                return false;
            }
        }
        return true;
    }
}
+4 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import android.os.Message;
import android.os.PowerManager;
import android.provider.Telephony.Sms.Intents;
import android.telephony.Rlog;
import com.android.internal.telephony.MSimConstants;

/**
 * Monitors the device and ICC storage, and sends the appropriate events.
@@ -53,6 +54,7 @@ public final class SmsStorageMonitor extends Handler {
    private PowerManager.WakeLock mWakeLock;

    private boolean mReportMemoryStatusPending;
    private PhoneBase mPhone;

    final CommandsInterface mCi;                            // accessed from inner class
    boolean mStorageAvailable = true;                       // accessed from inner class
@@ -70,6 +72,7 @@ public final class SmsStorageMonitor extends Handler {
    public SmsStorageMonitor(PhoneBase phone) {
        mContext = phone.getContext();
        mCi = phone.mCi;
        mPhone = phone;

        createWakelock();

@@ -138,6 +141,7 @@ public final class SmsStorageMonitor extends Handler {
    private void handleIccFull() {
        // broadcast SIM_FULL intent
        Intent intent = new Intent(Intents.SIM_FULL_ACTION);
        intent.putExtra(MSimConstants.SUBSCRIPTION_KEY, mPhone.getSubscription());
        mWakeLock.acquire(WAKE_LOCK_TIMEOUT);
        mContext.sendBroadcast(intent, android.Manifest.permission.RECEIVE_SMS);
    }
Loading