summaryrefslogtreecommitdiffstats
path: root/obex
diff options
context:
space:
mode:
authorMatthew Xie <mattx@google.com>2013-07-18 17:31:50 -0700
committerZhihai Xu <zhihaixu@google.com>2013-08-09 15:01:07 -0700
commitfe3807a5b23f54f6539436d71aa0cd931a2b76f0 (patch)
tree94ba6e1375140799abb46bcd9561a23ff8d626ad /obex
parent5af4edef084f4d3f94af71acca53c68929e82008 (diff)
downloadframeworks_base-fe3807a5b23f54f6539436d71aa0cd931a2b76f0.zip
frameworks_base-fe3807a5b23f54f6539436d71aa0cd931a2b76f0.tar.gz
frameworks_base-fe3807a5b23f54f6539436d71aa0cd931a2b76f0.tar.bz2
Bluetooth MAP profile - sms and mms support initial check-in
bug:10116530 Change-Id: I57d022005bcff5bc3e56438a81ac92566f957744
Diffstat (limited to 'obex')
-rw-r--r--obex/javax/obex/ClientOperation.java3
-rw-r--r--obex/javax/obex/HeaderSet.java2
-rw-r--r--obex/javax/obex/Operation.java2
-rw-r--r--obex/javax/obex/ServerOperation.java35
4 files changed, 32 insertions, 10 deletions
diff --git a/obex/javax/obex/ClientOperation.java b/obex/javax/obex/ClientOperation.java
index 05b498c..294b502 100644
--- a/obex/javax/obex/ClientOperation.java
+++ b/obex/javax/obex/ClientOperation.java
@@ -723,4 +723,7 @@ public final class ClientOperation implements Operation, BaseStream {
}
}
}
+
+ public void noBodyHeader(){
+ }
}
diff --git a/obex/javax/obex/HeaderSet.java b/obex/javax/obex/HeaderSet.java
index b89b707..2b3066f 100644
--- a/obex/javax/obex/HeaderSet.java
+++ b/obex/javax/obex/HeaderSet.java
@@ -464,6 +464,8 @@ public final class HeaderSet {
return mHttpHeader;
case WHO:
return mWho;
+ case CONNECTION_ID:
+ return mConnectionID;
case OBJECT_CLASS:
return mObjectClass;
case APPLICATION_PARAMETER:
diff --git a/obex/javax/obex/Operation.java b/obex/javax/obex/Operation.java
index 25656ed..5b4d5ace 100644
--- a/obex/javax/obex/Operation.java
+++ b/obex/javax/obex/Operation.java
@@ -178,4 +178,6 @@ public interface Operation {
void close() throws IOException;
int getMaxPacketSize();
+
+ public void noBodyHeader();
}
diff --git a/obex/javax/obex/ServerOperation.java b/obex/javax/obex/ServerOperation.java
index d1476d2..fc441e0 100644
--- a/obex/javax/obex/ServerOperation.java
+++ b/obex/javax/obex/ServerOperation.java
@@ -88,6 +88,8 @@ public final class ServerOperation implements Operation, BaseStream {
private boolean mHasBody;
+ private boolean mSendBodyHeader = true;
+
/**
* Creates new ServerOperation
* @param p the parent that created this object
@@ -364,24 +366,33 @@ public final class ServerOperation implements Operation, BaseStream {
* (End of Body) otherwise, we need to send 0x48 (Body)
*/
if ((finalBitSet) || (mPrivateOutput.isClosed())) {
- out.write(0x49);
+ if(mSendBodyHeader == true) {
+ out.write(0x49);
+ bodyLength += 3;
+ out.write((byte)(bodyLength >> 8));
+ out.write((byte)bodyLength);
+ out.write(body);
+ }
} else {
+ if(mSendBodyHeader == true) {
out.write(0x48);
+ bodyLength += 3;
+ out.write((byte)(bodyLength >> 8));
+ out.write((byte)bodyLength);
+ out.write(body);
+ }
}
- bodyLength += 3;
- out.write((byte)(bodyLength >> 8));
- out.write((byte)bodyLength);
- out.write(body);
}
}
if ((finalBitSet) && (type == ResponseCodes.OBEX_HTTP_OK) && (orginalBodyLength <= 0)) {
- out.write(0x49);
- orginalBodyLength = 3;
- out.write((byte)(orginalBodyLength >> 8));
- out.write((byte)orginalBodyLength);
-
+ if(mSendBodyHeader == true) {
+ out.write(0x49);
+ orginalBodyLength = 3;
+ out.write((byte)(orginalBodyLength >> 8));
+ out.write((byte)orginalBodyLength);
+ }
}
mResponseSize = 3;
@@ -711,4 +722,8 @@ public final class ServerOperation implements Operation, BaseStream {
public void streamClosed(boolean inStream) throws IOException {
}
+
+ public void noBodyHeader(){
+ mSendBodyHeader = false;
+ }
}