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

Commit 83b171a0 authored by Sungjae's avatar Sungjae
Browse files

Allow VoLTE retry if IMS is available for emergency



For GSI, useImsForEmergency should be checked before
trigerring VoLTE retry for emergency call.

Bug: 170785178

Signed-off-by: default avatarSungjae <sung_jae.kim@samsung.com>
Change-Id: I36662d6e1a9748874d44c529b502593dde9e27bf
parent 549368ca
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1561,7 +1561,7 @@ public class GsmCdmaCallTracker extends CallTracker {
                            TelephonyManager.getDefault().getNetworkType());
                }

                if (isEmcRetryCause(causeCode)) {
                if (isEmcRetryCause(causeCode) && mPhone.useImsForEmergency()) {
                    String dialString = "";
                    for(Connection conn : mForegroundCall.mConnections) {
                        GsmCdmaConnection gsmCdmaConnection = (GsmCdmaConnection)conn;
+12 −7
Original line number Diff line number Diff line
@@ -1233,6 +1233,17 @@ public class GsmCdmaPhone extends Phone {
                && (mImsPhone.getServiceState().getState() == ServiceState.STATE_IN_SERVICE);
    }

    public boolean useImsForEmergency() {
        CarrierConfigManager configManager =
                (CarrierConfigManager) mContext.getSystemService(Context.CARRIER_CONFIG_SERVICE);
        boolean alwaysTryImsForEmergencyCarrierConfig = configManager.getConfigForSubId(getSubId())
                .getBoolean(CarrierConfigManager.KEY_CARRIER_USE_IMS_FIRST_FOR_EMERGENCY_BOOL);
        return mImsPhone != null
                && alwaysTryImsForEmergencyCarrierConfig
                && ImsManager.getInstance(mContext, mPhoneId).isNonTtyOrTtyOnVolteEnabled()
                && mImsPhone.isImsAvailable();
    }

    @Override
    public Connection startConference(String[] participantsToDial, DialArgs dialArgs)
            throws CallStateException {
@@ -1278,19 +1289,13 @@ public class GsmCdmaPhone extends Phone {

        CarrierConfigManager configManager =
                (CarrierConfigManager) mContext.getSystemService(Context.CARRIER_CONFIG_SERVICE);
        boolean alwaysTryImsForEmergencyCarrierConfig = configManager.getConfigForSubId(getSubId())
                .getBoolean(CarrierConfigManager.KEY_CARRIER_USE_IMS_FIRST_FOR_EMERGENCY_BOOL);

        /** Check if the call is Wireless Priority Service call */
        boolean isWpsCall = dialString != null ? dialString.startsWith(PREFIX_WPS) : false;
        boolean allowWpsOverIms = configManager.getConfigForSubId(getSubId())
                .getBoolean(CarrierConfigManager.KEY_SUPPORT_WPS_OVER_IMS_BOOL);

        boolean useImsForEmergency = imsPhone != null
                && isEmergency
                && alwaysTryImsForEmergencyCarrierConfig
                && ImsManager.getInstance(mContext, mPhoneId).isNonTtyOrTtyOnVolteEnabled()
                && imsPhone.isImsAvailable();
        boolean useImsForEmergency = isEmergency && useImsForEmergency();

        String dialPart = PhoneNumberUtils.extractNetworkPortionAlt(PhoneNumberUtils.
                stripSeparators(dialString));