[BUGFIX]boundary problem
fix bug ID:API-11,API-12
Change-Id: I00d1793e5a1eb22ef025d606974749f165370c49
diff --git a/lib/liblynq-call/lynq_call.cpp b/lib/liblynq-call/lynq_call.cpp
index 45624b7..e1903ae 100755
--- a/lib/liblynq-call/lynq_call.cpp
+++ b/lib/liblynq-call/lynq_call.cpp
@@ -775,8 +775,18 @@
LYINFLOG("resp_type=%d,request=%d,slot_id=%d,error_code=%d",resp_type,request,slot_id,error);
return error;
}
+
+static int judge_mic(const int enable){
+ if(enable != 1 || enable != 0){
+ return 0;
+ }
+}
+
int lynq_set_mute_mic(const int enable)
-{
+{
+ if(!judge_mic(enable)){
+ return LYNQ_E_CONFLICT;
+ }
Parcel p;
lynq_client_t client;
int resp_type = -1;
@@ -831,8 +841,18 @@
return error;
}
+
+static int judge_volume(const int volume){
+ if(volume < 0 ||volume >36){
+ return 0;
+ }
+}
+
int lynq_set_DTMF_volume(const int volume)
-{
+{
+ if(!judge_volume(volume)){
+ return LYNQ_E_CONFLICT;
+ }
Parcel p;
lynq_client_t client;
int resp_type = -1;