diff options
author | Lixin Yue <L.X.YUE@motorola.com> | 2009-11-11 00:51:22 +0800 |
---|---|---|
committer | Jaikumar Ganesh <jaikumar@google.com> | 2009-11-10 15:34:18 -0800 |
commit | 65208317ba9d16486b47ebcaa868c596d424c87f (patch) | |
tree | 51825f34b55b0427c767a942af327cae7557dd4d /obex/javax/obex/ClientOperation.java | |
parent | e6ab011b8b8aa6c461e64cabb9b25d890d68edb1 (diff) |
Update OBEX to fix missing several contact entries issue.
The third parameter count of PrivateOutputStream.write()
should be the size of vcards data plus header length, excluding the 3 bytes
for the response message and 3 bytes for the header ID and length.
Adjust the return value of getMaxPacketSize() by minus headser size, so that
applications should not get packet slipped during multiple sharing operation.
Do not set the header to null in getHeaderLength() to get PBAP PTS passed;
Per OBEX spec, for Get request:
Only the last packet need send the 0x49(End of Body);
for intermediate packets, we need to send 0x48 (Body).
If all packets use 0x49, some carkit like Nokia PD-17 will fail to download
all contacts, except data in the last packet.
Bug: 2246927
Dr No: Eastham
Diffstat (limited to 'obex/javax/obex/ClientOperation.java')
-rw-r--r-- | obex/javax/obex/ClientOperation.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/obex/javax/obex/ClientOperation.java b/obex/javax/obex/ClientOperation.java index 65663b1a5bb9..05b498c1357f 100644 --- a/obex/javax/obex/ClientOperation.java +++ b/obex/javax/obex/ClientOperation.java @@ -269,7 +269,7 @@ public final class ClientOperation implements Operation, BaseStream { if (mPrivateOutput == null) { // there are 3 bytes operation headers and 3 bytes body headers // - mPrivateOutput = new PrivateOutputStream(this, mMaxPacketSize - 6); + mPrivateOutput = new PrivateOutputStream(this, getMaxPacketSize()); } mPrivateOutputOpen = true; @@ -278,7 +278,13 @@ public final class ClientOperation implements Operation, BaseStream { } public int getMaxPacketSize() { - return mMaxPacketSize - 6; + return mMaxPacketSize - 6 - getHeaderLength(); + } + + public int getHeaderLength() { + // OPP may need it + byte[] headerArray = ObexHelper.createHeader(mRequestHeader, false); + return headerArray.length; } /** |