OSDN Git Service

Support backward compatibility of new LAST_CALL_FAIL_CAUSE
authorSungmin Choi <sungmin.choi@lge.com>
Wed, 1 Jul 2015 07:22:46 +0000 (16:22 +0900)
committerChao Liu <yjl@google.com>
Mon, 6 Jul 2015 19:52:00 +0000 (12:52 -0700)
Previous fail cause returns integer array. New fail cuase returns integer and
string. RIL framework uses just integer as causeCode.
To support backward compatibility, returns integer instead of integer array
as causeCode.

Bug: 22204818
Change-Id: I77ca55d99a44d129cf401743c34c03754f38dde2

libril/ril.cpp

index a27495e..fc4ea51 100644 (file)
@@ -2181,7 +2181,12 @@ static int responseFailCause(Parcel &p, void *response, size_t responselen) {
     }
 
     if (responselen == sizeof(int)) {
-      return responseInts(p, response, responselen);
+      startResponse;
+      int *p_int = (int *) response;
+      appendPrintBuf("%s%d,", printBuf, p_int[0]);
+      p.writeInt32(p_int[0]);
+      removeLastChar;
+      closeResponse;
     } else if (responselen == sizeof(RIL_LastCallFailCauseInfo)) {
       startResponse;
       RIL_LastCallFailCauseInfo *p_fail_cause_info = (RIL_LastCallFailCauseInfo *) response;