Bug 1029387: Add result handler for Bluetooth Socket interface, r=shuang
Bug 1029387: Convert Bluedroid Socket's Listen method to asynchronous design, r=shuang
Bug 1029387: Convert Bluedroid Socket's Connect method to asynchronous design, r=shuang
Bug 1029387: Introduce connection status for Bluedroid sockets, r=shuang

In preparaton of moving the Bluedroid socket setup to BluetoothInterface,
this patch introduces connection states for Bluetooth sockets. There are
4 states,

  - Disconnected,
  - Listening,
  - Connecting, and
  - Connected.

All sockets start in Disconnected and transition to Connected via one
of the other states. Server socket transition through Listening, Client
sockets transition through Connecting. There is currently a lot of code
duplication in read and write methods. This will be cleaned up when the
connection setup is handled by BluetoothInterface.
Bug 1029387: Handle socket setup for |Connect| in BluetoothInterface, r=shuang

Bluedroid's internal socket setup transfers 2 messages and possibly
a file descriptor as the first data of a socket connection.

This patch moves the socket-setup code for the |Connect| call to
the implementation of BluetoothInterface. BluetoothSocket only
handles the socket setup of |Listen|, and general socket state.
Bug 1029387: Handle socket setup for |Accept| in BluetoothInterface, r=shuang

This patch moves the accept phase of Bluedroid's |Listen| to the
implementation of BluetoothInterface. |BluetoothInterface::Accept|
handles Bluedroid's socket-setup messages and executes the result
handler with the received file descriptor and data.
Bug 1029387: Remove socket setup from BluetoothSocket, r=shuang

This patch removes all code related to socket setup from Bluedroid's
BluetoothSocket. The socket setup is handled by BluetoothInterface;
transparantly to its users.

Since most of the socket setup is now hidden, a comment was added to
DroidSocketImpl that explains the connection phases in server and
client.