Fix FileIOInterruptTest.

The test was actually testing for a bug presence :).

Channel#write throws AsynchronousCloseException if other
thread closes channel. Now, android does that for EVERY close from other
thread.

OpenJdk throws AsynchronousCloseException only if NO data was written before interrupt.
I altered the ChannelWriter to write exactly 32k bytes and this
triggers this behavior. If some of data is written, the #write will return the number
of bytes written and then the FOLLOWING #write will throw ChannelClosedException because
file has been closed. Android is actually doing a wrong thing by always throwing the
AsynchronousCloseException. Client application have no idea that SOME data
was written in this case.

TODO: This behaviour is present in all AsynchronousCloseMonitor
users (I recently made FileInput/OutputStream use it :/). We either
fix the original read/write code in FileInput/OutputStream and
eredicate AsynchronousCloseMonitor from codebase, or fix
AsynchronousCloseMonitor.

Change-Id: I49fa02ed5be6cb21087a97715dc9c6780154ba46
1 file changed