OSDN Git Service

Refactor RFCOMM / BluetoothSocket usage of LocalSocket
authorNeil Fuller <nfuller@google.com>
Fri, 6 Jan 2017 11:29:15 +0000 (11:29 +0000)
committerNeil Fuller <nfuller@google.com>
Fri, 6 Jan 2017 14:18:07 +0000 (14:18 +0000)
commit7fd724611b8113c7f584c603d14fd44071cad799
tree1ffa97c2fc4156c2911bd51d7d512218c3c07185
parent43c98c74fe4b651810304e0862059234759437c6
Refactor RFCOMM / BluetoothSocket usage of LocalSocket

LocalSocket is used by BluetoothSocket. BluetoothSocket
passes a pre-created file descriptor to LocalSocket that
is then given to the LocalSocketImpl.

Commit b08c7bc0bdc48ae95be2697ca27ea89a9dd92c3e broke the
behavior. Commit 7a8c36aa4e6a1b5e48f0ee5a787f10bcfece7587
put in a minimal fix.

This change tidies up LocalSocket and associated classes
and replaces a specialist constructor with a factory method
to highlight the special case. While there an unnecessary
exception has been removed.

Bug: 34111534
Test: Boot device
Test: vogar --mode app_process tests/tests/net/src/android/net/cts/LocalSocketTest.java
Change-Id: I4ba2f2d9ea361a950ff8bc8d64fc800d998c3210
core/java/android/bluetooth/BluetoothSocket.java
core/java/android/net/LocalServerSocket.java
core/java/android/net/LocalSocket.java
core/java/android/net/LocalSocketImpl.java