Avoid calling ParcelFileDescriptor.fromSocket on new Sockets.

Previously, we were calling ParcelFileDescriptor.fromSocket on a newly
initialized Socket, which doesn't actually create a file descriptor
until the Socket is bound or connected.

Bind the Socket to a random port to force the file descriptor to be
allocated.

Test: treehugger
Change-Id: Id92a3e1316881d1c5382485aa2d6a41fc37e9651
2 files changed