diff options
author | Sukanya Rajkhowa <srajkh@codeaurora.org> | 2010-06-23 20:14:04 -0700 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2014-11-27 00:39:32 -0800 |
commit | 1af1adfe85061086780838c769af186ad271f268 (patch) | |
tree | 4189bbe4c996fe16dc1afae1fc480ec21e70e317 | |
parent | 5abb373f459983e754725471bccc7b31013963d4 (diff) | |
download | android_hardware_ril-1af1adfe85061086780838c769af186ad271f268.tar.gz android_hardware_ril-1af1adfe85061086780838c769af186ad271f268.tar.bz2 android_hardware_ril-1af1adfe85061086780838c769af186ad271f268.zip |
rild: Send extended information records as ByteBuffer
Send information records to java as a ByteBuffer to prevent
UTF-8 parsing from mangling bytes.
Change-Id: I558a41565b3e5e20aa40b5d0c5e748b204993e26
CRs-Fixed: 338368
-rw-r--r-- | libril/ril.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/libril/ril.cpp b/libril/ril.cpp index feaf60f..c5fdb4d 100644 --- a/libril/ril.cpp +++ b/libril/ril.cpp @@ -2584,7 +2584,6 @@ static int responseCdmaInformationRecords(Parcel &p, infoRec = &p_cur->infoRec[i]; p.writeInt32(infoRec->name); switch (infoRec->name) { - case RIL_CDMA_DISPLAY_INFO_REC: case RIL_CDMA_EXTENDED_DISPLAY_INFO_REC: if (infoRec->rec.display.alpha_len > CDMA_ALPHA_INFO_BUFFER_LENGTH) { @@ -2594,6 +2593,20 @@ static int responseCdmaInformationRecords(Parcel &p, CDMA_ALPHA_INFO_BUFFER_LENGTH); return RIL_ERRNO_INVALID_RESPONSE; } + // Write as a byteArray + p.writeInt32(infoRec->rec.display.alpha_len); + p.write(infoRec->rec.display.alpha_buf, + infoRec->rec.display.alpha_len); + break; + case RIL_CDMA_DISPLAY_INFO_REC: + if (infoRec->rec.display.alpha_len > + CDMA_ALPHA_INFO_BUFFER_LENGTH) { + RLOGE("invalid display info response length %d \ + expected not more than %d\n", + (int)infoRec->rec.display.alpha_len, + CDMA_ALPHA_INFO_BUFFER_LENGTH); + return RIL_ERRNO_INVALID_RESPONSE; + } string8 = (char*) malloc((infoRec->rec.display.alpha_len + 1) * sizeof(char) ); for (int i = 0 ; i < infoRec->rec.display.alpha_len ; i++) { |