aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvinash Malipatil <avinashmp@google.com>2023-12-07 07:38:32 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2023-12-07 07:38:32 +0000
commitc30a8236bbd4b659afa95e7fab5d354ac7f0f5b0 (patch)
treef827aaad9bf663d23f0397e0911c31b9706dc496
parent7e913029e6393382bbf45cac744c70ebe7b5b845 (diff)
parent1d1a95f9caf8507aa4d20ffa5e45eaa04c406a31 (diff)
downloadtelephony-c30a8236bbd4b659afa95e7fab5d354ac7f0f5b0.tar.gz
Merge "Save call disconnect info for error propagation" into main
-rw-r--r--src/java/com/android/internal/telephony/domainselection/NormalCallDomainSelectionConnection.java50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/java/com/android/internal/telephony/domainselection/NormalCallDomainSelectionConnection.java b/src/java/com/android/internal/telephony/domainselection/NormalCallDomainSelectionConnection.java
index 516d6b9b89..0532a05d41 100644
--- a/src/java/com/android/internal/telephony/domainselection/NormalCallDomainSelectionConnection.java
+++ b/src/java/com/android/internal/telephony/domainselection/NormalCallDomainSelectionConnection.java
@@ -22,9 +22,11 @@ import android.annotation.NonNull;
import android.annotation.Nullable;
import android.telephony.AccessNetworkConstants.RadioAccessNetworkType;
import android.telephony.Annotation.DisconnectCauses;
+import android.telephony.DisconnectCause;
import android.telephony.DomainSelectionService;
import android.telephony.DomainSelectionService.EmergencyScanType;
import android.telephony.NetworkRegistrationInfo;
+import android.telephony.PreciseDisconnectCause;
import android.telephony.ims.ImsReasonInfo;
import com.android.internal.telephony.Phone;
@@ -37,6 +39,9 @@ import java.util.concurrent.CompletableFuture;
public class NormalCallDomainSelectionConnection extends DomainSelectionConnection {
private static final boolean DBG = false;
+ private int mDisconnectCause = DisconnectCause.NOT_VALID;
+ private int mPreciseDisconnectCause = PreciseDisconnectCause.NOT_VALID;
+ private String mReasonMessage = null;
private @Nullable DomainSelectionConnectionCallback mCallback;
@@ -123,4 +128,49 @@ public class NormalCallDomainSelectionConnection extends DomainSelectionConnecti
}
return builder.build();
}
+
+ /**
+ * Save call disconnect info for error propagation.
+ * @param disconnectCause The code for the reason for the disconnect.
+ * @param preciseDisconnectCause The code for the precise reason for the disconnect.
+ * @param reasonMessage Description of the reason for the disconnect, not intended for the user
+ * to see.
+ */
+ public void setDisconnectCause(int disconnectCause, int preciseDisconnectCause,
+ String reasonMessage) {
+ mDisconnectCause = disconnectCause;
+ mPreciseDisconnectCause = preciseDisconnectCause;
+ mReasonMessage = reasonMessage;
+ }
+
+ public int getDisconnectCause() {
+ return mDisconnectCause;
+ }
+
+ public int getPreciseDisconnectCause() {
+ return mPreciseDisconnectCause;
+ }
+
+ public String getReasonMessage() {
+ return mReasonMessage;
+ }
+
+ /**
+ * @return imsReasonInfo Reason for the IMS call failure.
+ */
+ public @Nullable ImsReasonInfo getImsReasonInfo() {
+ if (getSelectionAttributes() == null) {
+ // Neither selectDomain(...) nor reselectDomain(...) has been called yet.
+ return null;
+ }
+
+ return getSelectionAttributes().getPsDisconnectCause();
+ }
+
+ /**
+ * @return phoneId To support localized message based on phoneId
+ */
+ public int getPhoneId() {
+ return getPhone().getPhoneId();
+ }
}