[feature][T8TSK-44][TCAM_T800_SW_0255] after cs call, Codec should sleep
Change-Id: I0dc4f7e65eb7deb0a63b1539165e82fccea6c153
diff --git a/framework/lynq-ril-service/src/cc.cpp b/framework/lynq-ril-service/src/cc.cpp
index 838bff9..d71ee34 100755
--- a/framework/lynq-ril-service/src/cc.cpp
+++ b/framework/lynq-ril-service/src/cc.cpp
@@ -1260,16 +1260,27 @@
return;
}
+/*hqing add for Geely demand on 11/07/2022, after cs call, codec should sleep*/
+void set_codec(int open)
+{
+ char cmd[64];
+ RLOGD("set_codec %d",open);
+ sprintf(cmd,\
+ "echo out 181 %d >/sys/devices/platform/10005000.pinctrl/mt_gpio", (open==0 ? 0:1));
+ system(cmd);
+}
+
//void callStateChange(void)
void speechonoff(int callnum)
{
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
+ if( callIndex >= 1 && 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");
+ set_codec(1); //hqing add for Geely demand on 11/07/2022, init cs call, open codec
if (get_audio_path() == 0) {
mixer_set(1);
speechStatus = NORMAL_SPEECH_ON;
@@ -1298,6 +1309,7 @@
speechStatus = SPEECH_OFF;
inCallstatus = CALL_OFF;
resetMute();
+ 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 {
RLOGD("callIndex is %d, speechStatus is %d.",callIndex, speechStatus);