OSDN Git Service

Process complete AT cmd response.
authorSatish Kodishala <skodisha@codeaurora.org>
Thu, 11 Feb 2016 17:05:40 +0000 (22:35 +0530)
committerAndre Eisenbach <eisenbach@google.com>
Fri, 25 Mar 2016 20:21:05 +0000 (13:21 -0700)
Usecase:
1. Enable hf client role and connect with AG.
2. Receive an incoming call and accept from hf client.
3. End call from hf client.
4. Repeat the steps few times.

Failure:
UI is not updated with proper call status although
call is active.

Root cause:
When OK is received as part of AT command response,
application is not updated for it. This caused response
state mismatch in application and hence queue was not
cleared properly.

Fix:
Parse complete AT command response and update application
accordingly.

Bug: 27852645
Change-Id: I8cb2362369b209903700e87330ed2a3e3052b188

bta/hf_client/bta_hf_client_at.c

index 610bc88..b273f2f 100644 (file)
@@ -991,6 +991,12 @@ static char *bta_hf_client_parse_cops(char *buffer)
     AT_CHECK_RN(buffer);
 
     bta_hf_client_handle_cops(opstr, mode);
+    // check for OK Response in end
+    AT_CHECK_EVENT(buffer, "OK");
+    AT_CHECK_RN(buffer);
+
+    bta_hf_client_handle_ok();
+
     return buffer;
 }
 
@@ -1025,6 +1031,13 @@ static char *bta_hf_client_parse_binp(char *buffer)
     AT_CHECK_RN(buffer);
 
     bta_hf_client_handle_binp(numstr);
+
+    // check for OK response in end
+    AT_CHECK_EVENT(buffer, "OK");
+    AT_CHECK_RN(buffer);
+
+    bta_hf_client_handle_ok();
+
     return buffer;
 }
 
@@ -1102,6 +1115,11 @@ static char *bta_hf_client_parse_clcc(char *buffer)
         bta_hf_client_handle_clcc(idx, dir, status, mode, mpty, NULL, 0);
     }
 
+    // check for OK response in end
+    AT_CHECK_EVENT(buffer, "OK");
+    AT_CHECK_RN(buffer);
+
+    bta_hf_client_handle_ok();
     return buffer;
 }
 
@@ -1163,6 +1181,12 @@ static char *bta_hf_client_parse_cnum(char *buffer)
     }
 
     bta_hf_client_handle_cnum(numstr, type, service);
+
+    // check for OK response in end
+    AT_CHECK_EVENT(buffer, "OK");
+    AT_CHECK_RN(buffer);
+
+    bta_hf_client_handle_ok();
     return buffer;
 }