summaryrefslogtreecommitdiff
path: root/services/QualifiedNetworksService/src/com
diff options
context:
space:
mode:
authorSewook Seo <sewookseo@google.com>2023-04-10 23:34:23 +0000
committerSewook Seo <sewookseo@google.com>2023-04-11 03:28:59 +0000
commitb220c166a74909e44a84f92dce5ec2e63cf77442 (patch)
tree3db58d67047c190635971b52555d2305b85752ab /services/QualifiedNetworksService/src/com
parent0ec6955ec5a701034c1624e2ebf6be1aa08238a1 (diff)
downloadTelephony-b220c166a74909e44a84f92dce5ec2e63cf77442.tar.gz
[QNS] Fixes on QnsCallStatusTracker
- fix wrong report from updateCallState - isCallIdle check based on NetCapability Bug: 276408745 Test: atest QualifiedNetworksServiceTests Change-Id: I570ab04be2ab3269a0cbb79b59c733459dcc6f08
Diffstat (limited to 'services/QualifiedNetworksService/src/com')
-rw-r--r--services/QualifiedNetworksService/src/com/android/telephony/qns/AccessNetworkEvaluator.java2
-rw-r--r--services/QualifiedNetworksService/src/com/android/telephony/qns/QnsCallStatusTracker.java35
2 files changed, 28 insertions, 9 deletions
diff --git a/services/QualifiedNetworksService/src/com/android/telephony/qns/AccessNetworkEvaluator.java b/services/QualifiedNetworksService/src/com/android/telephony/qns/AccessNetworkEvaluator.java
index 098820a..f77da91 100644
--- a/services/QualifiedNetworksService/src/com/android/telephony/qns/AccessNetworkEvaluator.java
+++ b/services/QualifiedNetworksService/src/com/android/telephony/qns/AccessNetworkEvaluator.java
@@ -1426,7 +1426,7 @@ class AccessNetworkEvaluator {
return true;
} else {
if (mNetCapability == NetworkCapabilities.NET_CAPABILITY_IMS
- && mCallType == QnsConstants.CALL_TYPE_IDLE) {
+ && mCallStatusTracker.isCallIdle(NetworkCapabilities.NET_CAPABILITY_IMS)) {
// Telephony will make new connection with preferred AccessNetwork
log("handover is not allowed. but need to move to target Transport.");
return true;
diff --git a/services/QualifiedNetworksService/src/com/android/telephony/qns/QnsCallStatusTracker.java b/services/QualifiedNetworksService/src/com/android/telephony/qns/QnsCallStatusTracker.java
index f8b335a..cc1f194 100644
--- a/services/QualifiedNetworksService/src/com/android/telephony/qns/QnsCallStatusTracker.java
+++ b/services/QualifiedNetworksService/src/com/android/telephony/qns/QnsCallStatusTracker.java
@@ -817,14 +817,18 @@ public class QnsCallStatusTracker {
}
}
//2. Notify a new ongoing call type
- if (hasEmergencyCall() && mLastEmergencyCallType != QnsConstants.CALL_TYPE_EMERGENCY) {
- mLastEmergencyCallType = QnsConstants.CALL_TYPE_EMERGENCY;
- if (!isDataNetworkConnected(NetworkCapabilities.NET_CAPABILITY_EIMS)
- && isDataNetworkConnected(NetworkCapabilities.NET_CAPABILITY_IMS)) {
- notifyCallType(NetworkCapabilities.NET_CAPABILITY_IMS, mLastEmergencyCallType);
- mEmergencyOverIms = true;
- } else {
- notifyCallType(NetworkCapabilities.NET_CAPABILITY_EIMS, mLastEmergencyCallType);
+ if (hasEmergencyCall()) {
+ if (mLastEmergencyCallType != QnsConstants.CALL_TYPE_EMERGENCY) {
+ mLastEmergencyCallType = QnsConstants.CALL_TYPE_EMERGENCY;
+ if (!isDataNetworkConnected(NetworkCapabilities.NET_CAPABILITY_EIMS)
+ && isDataNetworkConnected(NetworkCapabilities.NET_CAPABILITY_IMS)) {
+ notifyCallType(NetworkCapabilities.NET_CAPABILITY_IMS,
+ mLastEmergencyCallType);
+ mEmergencyOverIms = true;
+ } else {
+ notifyCallType(NetworkCapabilities.NET_CAPABILITY_EIMS,
+ mLastEmergencyCallType);
+ }
}
} else if (hasVideoCall()) {
if (mLastNormalCallType != QnsConstants.CALL_TYPE_VIDEO) {
@@ -865,6 +869,21 @@ public class QnsCallStatusTracker {
return mCallStates.size() == 0;
}
+ boolean isCallIdle(int netCapability) {
+ int callNum = mCallStates.size();
+ if (callNum == 0) {
+ return true;
+ }
+ if (netCapability == NetworkCapabilities.NET_CAPABILITY_IMS) {
+ return (mLastNormalCallType == QnsConstants.CALL_TYPE_IDLE)
+ && (mLastEmergencyCallType != QnsConstants.CALL_TYPE_IDLE
+ && !mEmergencyOverIms);
+ } else if (netCapability == NetworkCapabilities.NET_CAPABILITY_EIMS) {
+ return mLastEmergencyCallType == QnsConstants.CALL_TYPE_IDLE || mEmergencyOverIms;
+ }
+ return false;
+ }
+
boolean hasEmergencyCall() {
for (CallState cs : mCallStates) {
if (cs.getImsCallServiceType() == ImsCallProfile.SERVICE_TYPE_EMERGENCY