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

Commit 1481f324 authored by andychou's avatar andychou
Browse files

Dial WPS call over IMS or CS per CarrierConfigManager.KEY_SUPPORT_WPS_OVER_IMS_BOOL

Some carriers allow WPS over IMS but carrier not allow.
Add a carrier config and dial WPS call over IMS or CS per config value

Bug: 131917532
Test: Override Carrier Config and test WPS over IMS or CS
Change-Id: I1b79fdd407043b289c2708baba5951e5ef1d3086
parent 790906ff
Loading
Loading
Loading
Loading
+10 −1
Original line number Original line Diff line number Diff line
@@ -139,6 +139,7 @@ public class GsmCdmaPhone extends Phone {
    private static final String VM_NUMBER_CDMA = "vm_number_key_cdma";
    private static final String VM_NUMBER_CDMA = "vm_number_key_cdma";
    public static final int RESTART_ECM_TIMER = 0; // restart Ecm timer
    public static final int RESTART_ECM_TIMER = 0; // restart Ecm timer
    public static final int CANCEL_ECM_TIMER = 1; // cancel Ecm timer
    public static final int CANCEL_ECM_TIMER = 1; // cancel Ecm timer
    private static final String PREFIX_WPS = "*272";
    private CdmaSubscriptionSourceManager mCdmaSSM;
    private CdmaSubscriptionSourceManager mCdmaSSM;
    public int mCdmaSubscriptionSource = CdmaSubscriptionSourceManager.SUBSCRIPTION_SOURCE_UNKNOWN;
    public int mCdmaSubscriptionSource = CdmaSubscriptionSourceManager.SUBSCRIPTION_SOURCE_UNKNOWN;
    private PowerManager.WakeLock mWakeLock;
    private PowerManager.WakeLock mWakeLock;
@@ -1177,11 +1178,17 @@ public class GsmCdmaPhone extends Phone {
        boolean alwaysTryImsForEmergencyCarrierConfig = configManager.getConfigForSubId(getSubId())
        boolean alwaysTryImsForEmergencyCarrierConfig = configManager.getConfigForSubId(getSubId())
                .getBoolean(CarrierConfigManager.KEY_CARRIER_USE_IMS_FIRST_FOR_EMERGENCY_BOOL);
                .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 useImsForCall = isImsUseEnabled()
        boolean useImsForCall = isImsUseEnabled()
                 && imsPhone != null
                 && imsPhone != null
                 && (imsPhone.isVolteEnabled() || imsPhone.isWifiCallingEnabled() ||
                 && (imsPhone.isVolteEnabled() || imsPhone.isWifiCallingEnabled() ||
                 (imsPhone.isVideoEnabled() && VideoProfile.isVideo(dialArgs.videoState)))
                 (imsPhone.isVideoEnabled() && VideoProfile.isVideo(dialArgs.videoState)))
                 && (imsPhone.getServiceState().getState() == ServiceState.STATE_IN_SERVICE);
                 && (imsPhone.getServiceState().getState() == ServiceState.STATE_IN_SERVICE)
                 && (isWpsCall ? allowWpsOverIms : true);


        boolean useImsForEmergency = imsPhone != null
        boolean useImsForEmergency = imsPhone != null
                && isEmergency
                && isEmergency
@@ -1201,6 +1208,8 @@ public class GsmCdmaPhone extends Phone {
                    + ", useImsForEmergency=" + useImsForEmergency
                    + ", useImsForEmergency=" + useImsForEmergency
                    + ", useImsForUt=" + useImsForUt
                    + ", useImsForUt=" + useImsForUt
                    + ", isUt=" + isUt
                    + ", isUt=" + isUt
                    + ", isWpsCall=" + isWpsCall
                    + ", allowWpsOverIms=" + allowWpsOverIms
                    + ", imsPhone=" + imsPhone
                    + ", imsPhone=" + imsPhone
                    + ", imsPhone.isVolteEnabled()="
                    + ", imsPhone.isVolteEnabled()="
                    + ((imsPhone != null) ? imsPhone.isVolteEnabled() : "N/A")
                    + ((imsPhone != null) ? imsPhone.isVolteEnabled() : "N/A")