30 Commits

Author SHA1 Message Date
Hemant Gupta
9e91b62c1f OBEX: Add required parameters TAG ID's for PBAP 1.2
Add required OBEX application parameters TAGID's and length
declarations required to support PBAP 1.2 specification.

Test: Connected with Remote PBAP Client supporting PBAP 1.2 and
verified that connection and transfer happens over L2CAP.
Connected with Remote PBAP Client supporting PBAP 1.1 and
and verified that connection and transfer happens over RFCOMM.

Bug: 33011817
Change-Id: I8a772b0dddf6ecf74b057e12d7596421c0e0f558
2017-05-20 00:27:31 +00:00
Hemant Gupta
850758fb63 Bluetooth: OBEX: Don't close transport when obex is disconnected
Precondition: PTS 7.0

Usecase:
Execute test case TC_TG_CA_BI_02_C for AVRCP 1.6

Expectation:
Test case should pass

Observation:
Test case fails

Root cause:
Disconnection of OBEX from PTS leads to disconnection of transport
(initiated by DUT) leading to test case failure. Obex server was
unnecessary assuming that transport would be disconnected so was
informing registered users that transport has been disconnected,
which was leading to issues on new obex connect on same transport
channel from remote obex client

Fix:
Remove check to break out of loop after obex disconnection, as that is
already handled in case when read would return -1 in case transport
is closed.

Test: TC_TG_CA_BI_02_C can be passed after the patch.

Bug: 35590000
Change-Id: Ic1682ce77c07cf2e43da09dc95fff2214338f758
2017-05-03 19:37:18 +00:00
Hemant Gupta
3fba4935a7 OBEX: Set Min maxPacketLength negotiated in CONNECT Operation.
Set OBEX Server maxRxLength to the minium value acceptable from
either server and client during CONNECT Operation.

Below basic and all PUT test cases fail without this fix, as the
maxPacketLength for later is less than maxRxLength of server.
TC_MSE_MMU_BV_03_I
TC_MSE_MMU_BV_02_I

Change-Id: Iaa4f92e3146dc13d647dca12c84eb43b91657efa
2017-02-03 21:47:39 +00:00
Ajay Panicker
f8c2ad085b Allow getResponseCode to block if response hasn't been received from remote
Bug: 30645605
Change-Id: I9854ccbe98ace6d5490cb99586ca36379f5a1db1
2016-08-22 18:25:14 +00:00
AnubhavGupta
eed32008a8 Bluetooth: Send GET request as single packet
- If obex based profile explicitly sets GET with final flag, then
  GET should always be sent as single packet request with final flag
  set.

Change-Id: I82ff8295a239c4dbbfb4b3abfd358021820283cc
2016-06-15 23:06:31 +00:00
Hemant Gupta
50ba032f4a OBEX: Handle GET operation properly
This change handles GET operation properly whenever the
Input stream is getting aborted in between. Without this
patch it was observed that GET request was being sent by
DUT even when abort has been sent/received resulting
in IOT issues with some remote devices including PTS.

Change-Id: Idcb4ea04abb57353af5ab1fef050b3a36579892e
2015-05-16 01:19:19 +00:00
Casper Bonde
238e0f934f OBEX Over L2CAP + SDP search API for BT profiles
- Updated OBEX to support SRM
- Added support for OBEX over l2cap and SRM.
- Minor bugfixes, and reduce CPU load ALOT
- Added support to send responses without body data.
- Extend BluetoothSocket to support L2CAP
- Added functionality to get the channel number
  needed to be able to create an SDP record with the channel number.
- Added interface to get socket type and max packet sizes.
- Added interface to perform SDP search and get the resulting
  SDP record data.

Change-Id: I9d37a00ce73dfffc0e3ce03eab5511ba3a86e5b8
2015-04-11 01:49:11 +00:00
Hemant Gupta
8949bfb90c Bluetooth: Support MAP Client role on Bluedroid.
Implementation changes to support MAP client and PBAP client
role on Bluedroid stack.

Change-Id: I1733a67bf5256bd7b181bd5e68e40b476994ebfd
2014-07-01 18:01:27 +00:00
Kim Schulz
0d37605374 Fixed review comments
- fixed review comments (internal+google)
- corrected tabs/spaces
- Add connection id header for obex client operations
- added support for implementing ProfileService class

Change-Id: Idab8b4fa54a0f31bec4ffa263a69a9850a07f858

Bug:10692365
2013-09-12 19:07:28 -07:00
Matthew Xie
fe3807a5b2 Bluetooth MAP profile - sms and mms support initial check-in
bug:10116530

Change-Id: I57d022005bcff5bc3e56438a81ac92566f957744
2013-08-09 15:01:07 -07:00
Wei Zhong
789a01aa05 Add NOTICE and MODULE_LICENSE_BSD_LIKE for obex
"Copyright (c) 2008-2009, Motorola, Inc"

Bug: 6299628

Change-Id: Ia64d7341a8466ee9213ecabe6315c64b8643574e
Signed-off-by: Wei Zhong <wzhong@google.com>
(cherry picked from commit 559841702b8a8760e057af29d14d1a31ce75ff18)
2012-04-06 14:04:31 -07:00
Jaikumar Ganesh
3bec9cc27a am 0c2d82c6: am 848a1e3d: Merge "OBEX: Fix PrivateOutputStream small write problem"
* commit '0c2d82c6f28ab6ec73d66fcc1f62e067829df426':
  OBEX: Fix PrivateOutputStream small write problem
2011-05-20 10:51:25 -07:00
Erik Ljungberg
a9c4c594ef OBEX: Fix PrivateOutputStream small write problem
When data less than max packet size in length is sent into the write
method the data will only be added to the internal buffer. If several
calls to write is performed by the application continueOperation will
not be called at all. The solution to the problem is to always check
the internal buffer size and to call continueOperation every time
maxPacketSize bytes is in the internal buffer.

Change-Id: I5ebfa3c26db2c1aefe1a115d7782d8ceaa760937
2011-05-20 12:39:18 +02:00
Jaikumar Ganesh
ee1c033f6e am 24a16e6c: am c34c88b9: am ec1a8f7a: Merge "Unable to push files to Windows 7"
* commit '24a16e6c53d9b45c0cfdf150425002adc919955b':
  Unable to push files to Windows 7
2011-04-19 16:01:36 -07:00
Erik Ljungberg
e83b744d7d Unable to push files to Windows 7
Windows 7 says it can handle the maximum OBEX packet size. However
if the maximum packet size is used the transfer will fail. This
should be fixed by Microsoft but until they do the only way to solve
this is to reduce the maximum packet size for the OBEX client.

Change-Id: I51975eec972395ae3f1f21cca236b223d0812ef3
2011-03-22 07:58:43 +01:00
Brian Carlstrom
929a1c2192 Removing android.security.MessageDigest
Bug: 3392028
Change-Id: I6b9732da17d086ba00c846c3ad1c7fb39baf9502
2011-02-01 22:25:47 -08:00
Anders Petersson
4507b177c3 Bluetooth OBEX timeout problem.
Long time to show notification of file transfer failed after
canceling transfer via remote part.

Device A is in contact with our device, B. When device A Cancel
a transfer operation, it sends OBEX_OPCODE_DISCONNECT HeaderID
and the length of package to B. B use the length of package to
read remainder bytes from A. If the bytes B read do not meet the
received length it will block and wait for remainder bytes from A.
But when B compute the remainder bytes it forgets to subtract
the three bytes it has already read through HeaderID and the length
of the package. So the operation was blocked until the operation
timeout.

Change-Id: I0f8bf62d3119e081b5c01af9fc05fe586fd4fabc
2010-10-27 16:13:59 -07:00
Anders Petersson
faf49b14a2 Bluetooth OBEX timeout problem.
Long time to show notification of file transfer failed after
canceling transfer via remote part.

Device A is in contact with our device, B. When device A Cancel
a transfer operation, it sends OBEX_OPCODE_DISCONNECT HeaderID
and the length of package to B. B use the length of package to
read remainder bytes from A. If the bytes B read do not meet the
received length it will block and wait for remainder bytes from A.
But when B compute the remainder bytes it forgets to subtract
the three bytes it has already read through HeaderID and the length
of the package. So the operation was blocked until the operation
timeout.

Change-Id: I0f8bf62d3119e081b5c01af9fc05fe586fd4fabc
2010-10-27 08:38:30 +02:00
Lixin Yue
8258ebdf12 Add ABORT support to Obex lib 2010-03-16 09:59:06 -07:00
Lixin Yue
69f72c00a1 Update OBEX lib setPath Flags handling logic to be compatible with spec.
From IrOBEX, 3.3.6.1, we can see below explanation for Flags bit 1:
1  Don't create directory if it does not exist, return an error instead.
The correct understanding should be: if bit 1 is set to 1, we'll not create
directory if it not exist; if bit 1 is set to 0, we'll create it if it not
exists.
2009-12-16 17:33:02 -08:00
Lixin Yue
65208317ba 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
2009-11-10 15:34:18 -08:00
Oscar Montemayor
25f2c4cd95 Modified random variable to use java.security.SecureRandom for authentication challenge genration. 2009-09-20 13:23:36 -07:00
Tao Liejun
e80534ff59 Fix connection ID issue in Obex lib
ConnectionID should be consistent in one Obex session.
2009-09-15 09:54:20 -07:00
Jackson Fan
0b309d6ee4 Improve Obex compatibility
Handle headers with excessive whilespace
Send correct reponse code when client abort onPut
2009-08-19 21:07:52 -07:00
Tao Liejun
8d95d0a13a Fix a bug introduced in obex cleanup
Avoid exception when an empty array is passed to convert to Unicode
Before cleanup, there used to be an empty try/catch
2009-07-15 18:08:10 -07:00
Tao Liejun
05ff98bbef Fix minor obex bugs and re-format the comments
re-format comments
move connectible to connectable
remove unnecessary throws
remove not-used function ClientOperation.readResponse()
fix client abort case for PUT
set mOpen for PrivateOutputStream
add to platform.xml
2009-07-14 21:20:39 -07:00
Tao Liejun
3998bf009a Obex library cleanup, third pass
- Change variable namings
- Remove interface public modifier
- Move 2 duplicate methods to ObexSession
- Removed unused code and variables
- Use static variables for some protocol defines
2009-07-07 13:53:11 -07:00
Nick Pelly
41557e18fa Obex library cleanup, second pass.
o Use mMemberField variable naming as per style guide
o ClientSession.trans is only used in the ctor, doesn't need to be a member
o Rename connectionOpen to mOpen and isConnected to mObexConnected to reduce
  confusion
o Refactor duplicated code into helper functions (setRequestActive())
o Fix whitespace around comment blocks
o Change unnecessary public scope's to package private (eg setRequestInactive())
o Remove a redundant factory method ClientSession.createHeaderSet()
o Rename OPTIMIZATION to TODO to match Android style
o Rename java.io.IOException to IOException
o Be consistent with variable naming - use header not headers
2009-06-30 19:48:16 -07:00
Nick Pelly
2e0da96e75 Obex library cleanup, first pass.
o Add Android.mk file.
o Add @hide so it is not exposed in the public API. It is not yet in shape.
o Prefer @throws to @exception
o Do not use @version. This is meaningless in Android.
o Prefer classes 'final' unless explicitly allowing inheritance
 (See "Effective Java" item 15)
o Prefer CamelCaps java naming even for acronyms (OBEXHelper -> ObexHelper)
o Use the built-in MD5 library.
o Move ObexConstants into ObexHelper.
o Remove unused variables.
o Prefer stricter access priveleges. Most importantly, avoid public fields.
o Don't use 'import java.io.*'. Name each class explicitly.
o Delete commented out code. If its not used then remove it.
2009-06-30 19:47:54 -07:00
Nick Pelly
9439a7fe51 Add javax.obex library, contributed by Motorola.
Based of a JSR-82 reference implementation.

This check-in is 'as-is' from the source provided June 25.

This code does not conform to Android style and quality guidelines. I will be
working with Motorola to improve it. If it does not see substantial improvement
in the Eclair timeframe it will be deleted.
2009-06-30 19:45:24 -07:00