OPP: Have OBEX add 'End of Body' for a small file
When sending a file sized smaller than 'MaxPAcketSize', 'final packet' doesn't include 'End of body' header for 'put' operation. Therefore, some devices reply 'Bad Request' response code. See 'startProcessing()' fucntion in OBEX library. 'OBEX_OPCODE_PUT_FINAL' will be sent without body. Even it seems Android doesn't implement 'deleting' using 'put' operation, Spec says 'Body' or 'End of Body' can be omitted for 'Deleting an Object'. So Instead of changing OBEX, let's change function calling order between 'putOperation.getResponseCode()' and 'outputStream.close()' like Marshmallow OS. 'outputStream.close()' will make OBEX send all stored packets and then finally make final packet include 'End of Body' header. Bug: 63554262 Test: Send a file over OBEX to remote device Change-Id: I12bc3fd801d9a714dde947eb37bad9821ebb9d79
Loading