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

Commit 807b66ca authored by Brad Ebinger's avatar Brad Ebinger Committed by Automerger Merge Worker
Browse files

Merge "Allow VoLTE retry if IMS is available for emergency" am: 602ba8a4 am:...

Merge "Allow VoLTE retry if IMS is available for emergency" am: 602ba8a4 am: ad18a060 am: bfe95126 am: ad646e5e

Original change: https://android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/1459983

Change-Id: I284c66bce4b4f07bd03ccd133d8b181ee7c33c67
parents 77dceb2a ad646e5e
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1562,7 +1562,7 @@ public class GsmCdmaCallTracker extends CallTracker {
                            TelephonyManager.getDefault().getNetworkType());
                            TelephonyManager.getDefault().getNetworkType());
                }
                }


                if (isEmcRetryCause(causeCode)) {
                if (isEmcRetryCause(causeCode) && mPhone.useImsForEmergency()) {
                    String dialString = "";
                    String dialString = "";
                    for(Connection conn : mForegroundCall.mConnections) {
                    for(Connection conn : mForegroundCall.mConnections) {
                        GsmCdmaConnection gsmCdmaConnection = (GsmCdmaConnection)conn;
                        GsmCdmaConnection gsmCdmaConnection = (GsmCdmaConnection)conn;
+12 −7
Original line number Original line Diff line number Diff line
@@ -1238,6 +1238,17 @@ public class GsmCdmaPhone extends Phone {
                && (mImsPhone.getServiceState().getState() == ServiceState.STATE_IN_SERVICE);
                && (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
    @Override
    public Connection startConference(String[] participantsToDial, DialArgs dialArgs)
    public Connection startConference(String[] participantsToDial, DialArgs dialArgs)
            throws CallStateException {
            throws CallStateException {
@@ -1283,19 +1294,13 @@ public class GsmCdmaPhone extends Phone {


        CarrierConfigManager configManager =
        CarrierConfigManager configManager =
                (CarrierConfigManager) mContext.getSystemService(Context.CARRIER_CONFIG_SERVICE);
                (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 */
        /** Check if the call is Wireless Priority Service call */
        boolean isWpsCall = dialString != null ? dialString.startsWith(PREFIX_WPS) : false;
        boolean isWpsCall = dialString != null ? dialString.startsWith(PREFIX_WPS) : false;
        boolean allowWpsOverIms = configManager.getConfigForSubId(getSubId())
        boolean allowWpsOverIms = configManager.getConfigForSubId(getSubId())
                .getBoolean(CarrierConfigManager.KEY_SUPPORT_WPS_OVER_IMS_BOOL);
                .getBoolean(CarrierConfigManager.KEY_SUPPORT_WPS_OVER_IMS_BOOL);


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


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