5 Commits

Author SHA1 Message Date
Dan Egnor
6e6d60d4c8 Avoid leaking file descriptors when returning drop box events.
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
2010-07-21 12:52:21 -07:00
Dan Egnor
3a8b0c18a4 Limit DropBox storage to 1000 files (by default).
Also does trimming asynchronously (not directly in the broadcast receiver).

Bug: 2541253
Change-Id: I7daf8bc618e2dce68a98571f5f7fbce4df1d6a76
2010-03-24 17:48:20 -07:00
Nick Kralevich
93a68398b6 Unittests for EntropyService. Make EntropyService more testable.
I've been meaning to write these tests for a long time...

Use "runtest frameworks-services" to run these tests.

Change-Id: I3a3cb7eda547f4a790f38be884b4a583426c7326
2010-03-19 16:57:21 -07:00
Neal Nguyen
3433d3c90e Modifying Services Tests XML file so it builds with the right permissions. 2010-02-02 17:09:00 -08:00
Neal Nguyen
1a44d5dcab Phase 2 of test cleanup: moving test files from AndroidTests closer to their sources.
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
2010-01-29 13:35:51 -08:00