Loading src/java/com/android/internal/telephony/CallStateException.java +1 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ public class CallStateException extends Exception /** The error code is not valid (Not received a disconnect cause) */ public static final int ERROR_INVALID = -1; public static final int ERROR_DISCONNECTED = 1; public static final int ERROR_OUT_OF_SERVICE = 1; public static final int ERROR_POWER_OFF = 2; public Loading src/java/com/android/internal/telephony/GsmCdmaPhone.java +12 −1 Original line number Diff line number Diff line Loading @@ -62,7 +62,6 @@ import android.telephony.SubscriptionInfo; import android.telephony.SubscriptionManager; import android.telephony.TelephonyManager; import android.telephony.UssdResponse; import android.telephony.cdma.CdmaCellLocation; import android.text.TextUtils; import android.util.Log; Loading Loading @@ -1129,6 +1128,18 @@ public class GsmCdmaPhone extends Phone { CallStateException.ERROR_POWER_OFF, "cannot dial voice call in airplane mode"); } // Check for service before placing non emergency CS voice call. // Allow dial only if either CS is camped on any RAT (or) PS is in LTE service. if (mSST != null && mSST.mSS.getState() == ServiceState.STATE_OUT_OF_SERVICE /* CS out of service */ && !(mSST.mSS.getDataRegState() == ServiceState.STATE_IN_SERVICE && ServiceState.isLte(mSST.mSS.getRilDataRadioTechnology())) /* PS not in LTE */ && !VideoProfile.isVideo(videoState) /* voice call */ && !isEmergency /* non-emergency call */) { throw new CallStateException( CallStateException.ERROR_OUT_OF_SERVICE, "cannot dial voice call in out of service"); } if (DBG) logd("Trying (non-IMS) CS call"); if (isPhoneTypeGsm()) { Loading src/java/com/android/internal/telephony/Phone.java +1 −2 Original line number Diff line number Diff line Loading @@ -59,7 +59,6 @@ import com.android.ims.ImsManager; import com.android.internal.R; import com.android.internal.telephony.dataconnection.DcTracker; import com.android.internal.telephony.imsphone.ImsPhoneCall; import com.android.internal.telephony.ims.ImsResolver; import com.android.internal.telephony.test.SimulatedRadioControl; import com.android.internal.telephony.uicc.IccCardApplicationStatus.AppType; import com.android.internal.telephony.uicc.IccFileHandler; Loading Loading @@ -3384,7 +3383,7 @@ public abstract class Phone extends Handler implements PhoneInternalInterface { ImsConfig.WfcModeFeatureValueConstants.WIFI_ONLY)); if (wfcWiFiOnly) { throw new CallStateException( CallStateException.ERROR_DISCONNECTED, CallStateException.ERROR_OUT_OF_SERVICE, "WFC Wi-Fi Only Mode: IMS not registered"); } } Loading tests/telephonytests/src/com/android/internal/telephony/CallStateExceptionTest.java +5 −3 Original line number Diff line number Diff line Loading @@ -15,10 +15,12 @@ */ package com.android.internal.telephony; import static org.junit.Assert.assertEquals; import android.test.suitebuilder.annotation.SmallTest; import org.junit.After; import org.junit.Test; import static org.junit.Assert.assertEquals; public class CallStateExceptionTest { private CallStateException mCallStateException; Loading @@ -39,9 +41,9 @@ public class CallStateExceptionTest { @Test @SmallTest public void testCallStateExceptionWithErrCode() { mCallStateException = new CallStateException(mCallStateException.ERROR_DISCONNECTED, mCallStateException = new CallStateException(mCallStateException.ERROR_OUT_OF_SERVICE, "sanity test with err code"); assertEquals("sanity test with err code", mCallStateException.getMessage()); assertEquals(mCallStateException.ERROR_DISCONNECTED, mCallStateException.getError()); assertEquals(mCallStateException.ERROR_OUT_OF_SERVICE, mCallStateException.getError()); } } Loading
src/java/com/android/internal/telephony/CallStateException.java +1 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ public class CallStateException extends Exception /** The error code is not valid (Not received a disconnect cause) */ public static final int ERROR_INVALID = -1; public static final int ERROR_DISCONNECTED = 1; public static final int ERROR_OUT_OF_SERVICE = 1; public static final int ERROR_POWER_OFF = 2; public Loading
src/java/com/android/internal/telephony/GsmCdmaPhone.java +12 −1 Original line number Diff line number Diff line Loading @@ -62,7 +62,6 @@ import android.telephony.SubscriptionInfo; import android.telephony.SubscriptionManager; import android.telephony.TelephonyManager; import android.telephony.UssdResponse; import android.telephony.cdma.CdmaCellLocation; import android.text.TextUtils; import android.util.Log; Loading Loading @@ -1129,6 +1128,18 @@ public class GsmCdmaPhone extends Phone { CallStateException.ERROR_POWER_OFF, "cannot dial voice call in airplane mode"); } // Check for service before placing non emergency CS voice call. // Allow dial only if either CS is camped on any RAT (or) PS is in LTE service. if (mSST != null && mSST.mSS.getState() == ServiceState.STATE_OUT_OF_SERVICE /* CS out of service */ && !(mSST.mSS.getDataRegState() == ServiceState.STATE_IN_SERVICE && ServiceState.isLte(mSST.mSS.getRilDataRadioTechnology())) /* PS not in LTE */ && !VideoProfile.isVideo(videoState) /* voice call */ && !isEmergency /* non-emergency call */) { throw new CallStateException( CallStateException.ERROR_OUT_OF_SERVICE, "cannot dial voice call in out of service"); } if (DBG) logd("Trying (non-IMS) CS call"); if (isPhoneTypeGsm()) { Loading
src/java/com/android/internal/telephony/Phone.java +1 −2 Original line number Diff line number Diff line Loading @@ -59,7 +59,6 @@ import com.android.ims.ImsManager; import com.android.internal.R; import com.android.internal.telephony.dataconnection.DcTracker; import com.android.internal.telephony.imsphone.ImsPhoneCall; import com.android.internal.telephony.ims.ImsResolver; import com.android.internal.telephony.test.SimulatedRadioControl; import com.android.internal.telephony.uicc.IccCardApplicationStatus.AppType; import com.android.internal.telephony.uicc.IccFileHandler; Loading Loading @@ -3384,7 +3383,7 @@ public abstract class Phone extends Handler implements PhoneInternalInterface { ImsConfig.WfcModeFeatureValueConstants.WIFI_ONLY)); if (wfcWiFiOnly) { throw new CallStateException( CallStateException.ERROR_DISCONNECTED, CallStateException.ERROR_OUT_OF_SERVICE, "WFC Wi-Fi Only Mode: IMS not registered"); } } Loading
tests/telephonytests/src/com/android/internal/telephony/CallStateExceptionTest.java +5 −3 Original line number Diff line number Diff line Loading @@ -15,10 +15,12 @@ */ package com.android.internal.telephony; import static org.junit.Assert.assertEquals; import android.test.suitebuilder.annotation.SmallTest; import org.junit.After; import org.junit.Test; import static org.junit.Assert.assertEquals; public class CallStateExceptionTest { private CallStateException mCallStateException; Loading @@ -39,9 +41,9 @@ public class CallStateExceptionTest { @Test @SmallTest public void testCallStateExceptionWithErrCode() { mCallStateException = new CallStateException(mCallStateException.ERROR_DISCONNECTED, mCallStateException = new CallStateException(mCallStateException.ERROR_OUT_OF_SERVICE, "sanity test with err code"); assertEquals("sanity test with err code", mCallStateException.getMessage()); assertEquals(mCallStateException.ERROR_DISCONNECTED, mCallStateException.getError()); assertEquals(mCallStateException.ERROR_OUT_OF_SERVICE, mCallStateException.getError()); } }