Commit 4d75fa1d authored by Amit Mahajan's avatar Amit Mahajan
Browse files

Fix useImsForUt check

The check was looking at last character to determine if dialed
number is UT which is not correct. Should look at the last character
of the network portion.

Bug: 24125413
Change-Id: I21e0d2ffac4548d74e68355db86a98516daee304
parent 4677e1d9
......@@ -442,13 +442,16 @@ public class CDMAPhone extends PhoneBase {
&& ImsManager.isNonTtyOrTtyOnVolteEnabled(mContext)
&& (imsPhone.getServiceState().getState() != ServiceState.STATE_POWER_OFF);
boolean useImsForUt = imsPhone != null && imsPhone.isUtEnabled()
&& dialString.endsWith("#");
boolean isUt = PhoneNumberUtils.extractNetworkPortionAlt(PhoneNumberUtils.
stripSeparators(dialString)).endsWith("#");
boolean useImsForUt = imsPhone != null && imsPhone.isUtEnabled();
if (DBG) {
Rlog.d(LOG_TAG, "imsUseEnabled=" + imsUseEnabled
+ ", useImsForEmergency=" + useImsForEmergency
+ ", useImsForUt=" + useImsForUt
+ ", isUt=" + isUt
+ ", imsPhone=" + imsPhone
+ ", imsPhone.isVolteEnabled()="
+ ((imsPhone != null) ? imsPhone.isVolteEnabled() : "N/A")
......@@ -460,7 +463,7 @@ public class CDMAPhone extends PhoneBase {
ImsPhone.checkWfcWifiOnlyModeBeforeDial(mImsPhone, mContext);
if (imsUseEnabled || useImsForEmergency || useImsForUt) {
if ((imsUseEnabled && (!isUt || useImsForUt)) || useImsForEmergency) {
try {
if (DBG) Rlog.d(LOG_TAG, "Trying IMS PS call");
return imsPhone.dial(dialString, uusInfo, videoState, intentExtras);
......
......@@ -812,18 +812,21 @@ public class GSMPhone extends PhoneBase {
boolean useImsForEmergency = imsPhone != null
&& isEmergency
&& mContext.getResources().getBoolean(
&& mContext.getResources().getBoolean(
com.android.internal.R.bool.useImsAlwaysForEmergencyCall)
&& ImsManager.isNonTtyOrTtyOnVolteEnabled(mContext)
&& (imsPhone.getServiceState().getState() != ServiceState.STATE_POWER_OFF);
boolean useImsForUt = imsPhone != null && imsPhone.isUtEnabled()
&& dialString.endsWith("#");
boolean isUt = PhoneNumberUtils.extractNetworkPortionAlt(PhoneNumberUtils.
stripSeparators(dialString)).endsWith("#");
boolean useImsForUt = imsPhone != null && imsPhone.isUtEnabled();
if (LOCAL_DEBUG) {
Rlog.d(LOG_TAG, "imsUseEnabled=" + imsUseEnabled
+ ", useImsForEmergency=" + useImsForEmergency
+ ", useImsForUt=" + useImsForUt
+ ", isUt=" + isUt
+ ", imsPhone=" + imsPhone
+ ", imsPhone.isVolteEnabled()="
+ ((imsPhone != null) ? imsPhone.isVolteEnabled() : "N/A")
......@@ -835,7 +838,7 @@ public class GSMPhone extends PhoneBase {
ImsPhone.checkWfcWifiOnlyModeBeforeDial(mImsPhone, mContext);
if (imsUseEnabled || useImsForEmergency || useImsForUt) {
if ((imsUseEnabled && (!isUt || useImsForUt)) || useImsForEmergency) {
try {
if (LOCAL_DEBUG) Rlog.d(LOG_TAG, "Trying IMS PS call");
return imsPhone.dial(dialString, uusInfo, videoState, intentExtras);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment