12 Commits

Author SHA1 Message Date
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