diff options
author | Sukanya Rajkhowa <srajkh@codeaurora.org> | 2010-06-23 20:14:04 -0700 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2015-10-06 03:20:15 -0600 |
commit | 310ce7080ed4fcdfc15a6153f1b2f9cf9ce44d98 (patch) | |
tree | b7a98fec7ec1c895ce5732d85820c226754b7e8c | |
parent | 99f88fe395466e34d654fe3097f8c822c04f3546 (diff) | |
download | android_hardware_ril-310ce7080ed4fcdfc15a6153f1b2f9cf9ce44d98.tar.gz android_hardware_ril-310ce7080ed4fcdfc15a6153f1b2f9cf9ce44d98.tar.bz2 android_hardware_ril-310ce7080ed4fcdfc15a6153f1b2f9cf9ce44d98.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
-rwxr-xr-x | libril/ril.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/libril/ril.cpp b/libril/ril.cpp index af5a40e..c7df4af 100755 --- a/libril/ril.cpp +++ b/libril/ril.cpp @@ -2772,7 +2772,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) { @@ -2782,6 +2781,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++) { |