Merge "[BugFix][T800][task-view-137]free dataconnection before reporting the PDN_DISCONNECTED"
diff --git a/IC_src/mtk/telephonyware/3.0/libvendor-ril/mtk-rilproxy/telephony/data/DcTracker.cpp b/IC_src/mtk/telephonyware/3.0/libvendor-ril/mtk-rilproxy/telephony/data/DcTracker.cpp
index 0f3917d..96d2901 100755
--- a/IC_src/mtk/telephonyware/3.0/libvendor-ril/mtk-rilproxy/telephony/data/DcTracker.cpp
+++ b/IC_src/mtk/telephonyware/3.0/libvendor-ril/mtk-rilproxy/telephony/data/DcTracker.cpp
@@ -320,8 +320,11 @@
     ApnContext *apnContext = DcTracker::mApnContexts.find(apnType)->second;
     DataConnection *currentDataConnection = apnContext->getDataConnection();
 
+    //xy.he modified for task-view-137 on 20240808 started
     //the old connection is invalid.
-    apnContext->setSate(RIL_Data_Call_PdnState::PDN_DISCONNECTED);
+    //apnContext->setSate(RIL_Data_Call_PdnState::PDN_DISCONNECTED);
+    //xy.he modified for task-view-137 on 20240808 ended
+    
 
     if (currentDataConnection != NULL) {
         RFX_LOG_D(RFX_LOG_TAG, "onDeactiveConnectionCompleted, free data connection with info: %s .",
@@ -351,6 +354,11 @@
     }
 
     apnContext->setDataConnection(NULL);
+
+    //xy.he modified for task-view-137 on 20240808 started
+    //the old connection is invalid.
+    apnContext->setSate(RIL_Data_Call_PdnState::PDN_DISCONNECTED);
+    //xy.he modified for task-view-137 on 20240808 ended
     //the current apn setting should be invalid.
     apnContext->getApnSetting().clear();
     // remove the record