[Feature][T8TSK-301][audio]  config audio 2 set parameter,  rtp and local

           Affected branch: unknown
           Affected module: unknown
           Is it affected on both ZXIC and MTK: only MTK
           Self-test: Yes
           Doc Update: No

Change-Id: I18bb2dca9e9134758d5523fa39d6afed8e8b314a
diff --git a/framework/lynq-ril-service/src/cc.cpp b/framework/lynq-ril-service/src/cc.cpp
index f6cc262..f900f1e 100755
--- a/framework/lynq-ril-service/src/cc.cpp
+++ b/framework/lynq-ril-service/src/cc.cpp
@@ -47,6 +47,7 @@
 /*Warren add for t800 ril servie 2021/12/23 start*/
 #include "lynq_interface.h"
 #include <binder/Parcel.h>
+#include "call_rtp.h"
 using android::Parcel;
 /*Warren add for t800 ril servie 2021/12/23 end*/
 
@@ -167,10 +168,19 @@
 
      //set mixer ctl to om:1 or off:0
     if(value){
-        ret = set_mixer_ctrl_value_int(isEcallAudioPath() ? g_mixer_name_ecall: g_mixer_name, value);
-        RLOGD("mixer_set(%s) = %d, ret: %d", (isEcallAudioPath() ? g_mixer_name_ecall: g_mixer_name), value, ret);
-    } else {
-        //setEcallAudioPathOn(false);
+        //ret = set_mixer_ctrl_value_int(isEcallAudioPath() ? g_mixer_name_ecall: g_mixer_name, value);
+        if(isEcallAudioPath())
+        {
+            exe_set_voice_audio_mode(AUDIO_MODE_CODEC);
+        }
+        else 
+        {
+            exe_set_voice_audio_mode(AUDIO_MODE_RTP);
+        }
+     // RLOGD("mixer_set(%s) = %d, ret: %d", (isEcallAudioPath() ? g_mixer_name_ecall: g_mixer_name), value, ret);
+    } else {   
+        exe_set_voice_audio_mode(AUDIO_MODE_ALL_CLOSE);
+/*        
         ret = get_mixer_ctrl_value_int(g_mixer_name);
         RLOGD("mixer_set(get_mixer_ctrl_value_int: %s) = %d", g_mixer_name, ret);
         if(ret > 0) {
@@ -180,6 +190,7 @@
             ret = set_mixer_ctrl_value_int(g_mixer_name_ecall, value);
             RLOGD("mixer_set(%s) = %d", g_mixer_name_ecall, ret);
         }
+*/
     }
 
 
@@ -387,7 +398,7 @@
     }
     }
     p.setDataPosition(pos);
-    setEcallAudioPathOn(false);
+//  setEcallAudioPathOn(false);
     pRI->pCI->dispatchFunction(p, pRI);
     inCallstatus = CALL_ON;
     return 0;
@@ -707,7 +718,7 @@
 #endif
 
     p.setDataPosition(pos);
-    setEcallAudioPathOn(false);
+//  setEcallAudioPathOn(false);
     pRI->pCI->dispatchFunction(p, pRI);
     return 0;
 }
@@ -1010,7 +1021,7 @@
     }
   }
   p.setDataPosition(pos);
-  setEcallAudioPathOn(false);
+//setEcallAudioPathOn(false);
   pRI->pCI->dispatchFunction(p, pRI);
   return 0;
 }
@@ -1393,7 +1404,8 @@
     static int callIndex = 0;
     RLOGD("callnum = %d, Call State Change then judge speech on/off!", callnum);
     callIndex = callnum;
-    if( callIndex >= 1 && speechStatus == SPEECH_OFF) {  //speech on
+    lock_rtp_audio_mtx(); 	
+    if( callIndex > 0 && speechStatus == SPEECH_OFF) {  //speech on
         //RLOGD("DemoAPP Call shell command (pactl set-card-profile 0 phonecall)");
         //system("pactl set-card-profile 0 phonecall");
         //RLOGD("DemoAPP Call shell command end");
@@ -1406,6 +1418,7 @@
             speechStatus = BT_SPEECH_ON;
         }
         inCallstatus = CALL_ON;
+        unlock_rtp_audio_mtx();
         RLOGD("[speech]: set on");
         sendCallMsg(true); //for Power Manager test
     } else if (callIndex == 0
@@ -1426,9 +1439,11 @@
         speechStatus = SPEECH_OFF;
         inCallstatus = CALL_OFF;
         resetMute();
+        unlock_rtp_audio_mtx();
         set_codec(0); //hqing add for Geely demand on 11/07/2022, after cs call, close codec for power Manager
         RLOGD("[speech]: set off");
     } else {
+        unlock_rtp_audio_mtx();
         RLOGD("callIndex is %d, speechStatus is %d.",callIndex, speechStatus);
     }