We can't use Parcel.writeValue() to write the ParcelFileDescriptor, otherwise
it leaks when returning the value to the caller (the flag gets lost). Change
the way DropBoxManager.Entry gets serialized so that it uses a bit of its own
flags value to track whether the data is a byte[] or a ParcelFileDescriptor.
Modify the dropbox unit test to add extensive checking of Entry serialization
and deserialization under various circumstances, and to include a regression
test to ensure that FD leaking doesn't happen.
Bug: 2847738
Change-Id: I4ccd17dd03ffab234340cd359e6f3510fdf81193
I've been meaning to write these tests for a long time...
Use "runtest frameworks-services" to run these tests.
Change-Id: I3a3cb7eda547f4a790f38be884b4a583426c7326
Most of these are file moves; a couple notable exceptions are the changes due to the move, and fixing up test code:
- database/DatabaseCursorTest.java
- database/DatabaseStatementTest.java
- net/UriTest.java