Check for Service state (VoiceRegState) only before placing call over CS domain
Bug: 359081823
Flag: EXEMPT bugfix
Test: atest TeleServiceTests:NormalCallDomainSelectorTest
Test: Manual verification in VZ, JIO and TMO networks
Change-Id: Ib91a6be06be8784c14880a539fb570064dffd199
diff --git a/src/com/android/services/telephony/domainselection/NormalCallDomainSelector.java b/src/com/android/services/telephony/domainselection/NormalCallDomainSelector.java
index 906aa28..37813e3 100644
--- a/src/com/android/services/telephony/domainselection/NormalCallDomainSelector.java
+++ b/src/com/android/services/telephony/domainselection/NormalCallDomainSelector.java
@@ -263,6 +263,12 @@
}
private void notifyCsSelected() {
+ if (isOutOfService()) {
+ loge("Cannot place call in current ServiceState: " + mServiceState.getState());
+ notifySelectionTerminated(DisconnectCause.OUT_OF_SERVICE);
+ return;
+ }
+
logd("notifyCsSelected");
mSelectorState = SelectorState.INACTIVE;
if (mWwanSelectorCallback == null) {
@@ -317,26 +323,14 @@
logd("WPS call placed over PS");
notifyPsSelected();
} else {
- if (isOutOfService()) {
- loge("Cannot place call in current ServiceState: " + mServiceState.getState());
- notifySelectionTerminated(DisconnectCause.OUT_OF_SERVICE);
- } else {
- logd("WPS call placed over CS");
- notifyCsSelected();
- }
+ logd("WPS call placed over CS");
+ notifyCsSelected();
}
}
private void handleReselectDomain(ImsReasonInfo imsReasonInfo) {
mReselectDomain = false;
- // Out of service
- if (isOutOfService()) {
- loge("Cannot place call in current ServiceState: " + mServiceState.getState());
- notifySelectionTerminated(DisconnectCause.OUT_OF_SERVICE);
- return;
- }
-
// IMS -> CS
if (imsReasonInfo != null) {
logd("PsDisconnectCause:" + imsReasonInfo.getCode());
@@ -413,12 +407,7 @@
if (!mImsStateTracker.isMmTelFeatureAvailable()) {
logd("MmTelFeatureAvailable unavailable");
- if (isOutOfService()) {
- loge("Cannot place call in current ServiceState: " + mServiceState.getState());
- notifySelectionTerminated(DisconnectCause.OUT_OF_SERVICE);
- } else {
- notifyCsSelected();
- }
+ notifyCsSelected();
return;
}
@@ -434,23 +423,13 @@
// Check IMS registration state.
if (!mImsStateTracker.isImsRegistered()) {
logd("IMS is NOT registered");
- if (isOutOfService()) {
- loge("Cannot place call in current ServiceState: " + mServiceState.getState());
- notifySelectionTerminated(DisconnectCause.OUT_OF_SERVICE);
- } else {
- notifyCsSelected();
- }
+ notifyCsSelected();
return;
}
// Check TTY
if (isTtyModeEnabled() && !isTtySupportedByIms()) {
- if (isOutOfService()) {
- loge("Cannot place call in current ServiceState: " + mServiceState.getState());
- notifySelectionTerminated(DisconnectCause.OUT_OF_SERVICE);
- } else {
- notifyCsSelected();
- }
+ notifyCsSelected();
return;
}
@@ -479,12 +458,7 @@
} else {
logd("IMS is not voice capable");
// Voice call CS fallback
- if (isOutOfService()) {
- loge("Cannot place call in current ServiceState: " + mServiceState.getState());
- notifySelectionTerminated(DisconnectCause.OUT_OF_SERVICE);
- } else {
- notifyCsSelected();
- }
+ notifyCsSelected();
}
}