summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2015-11-02 07:25:56 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2015-11-02 07:25:55 -0800
commit11018151c03612f54da2c4acf7d22c2f48bf835c (patch)
tree16f9666d07380a123c022625a2d28597b0698a3e
parent39c754f9db0bbe37b3b58aa85584d0e0f714f663 (diff)
parentf1779be3ab0cb103d64df2abedbd7ee04e3683ee (diff)
downloadandroid_packages_apps_BluetoothExt-11018151c03612f54da2c4acf7d22c2f48bf835c.tar.gz
android_packages_apps_BluetoothExt-11018151c03612f54da2c4acf7d22c2f48bf835c.tar.bz2
android_packages_apps_BluetoothExt-11018151c03612f54da2c4acf7d22c2f48bf835c.zip
Merge "Bluetooth: Create ftp sdp record in accept thread"
-rw-r--r--src/org/codeaurora/bluetooth/ftp/BluetoothFtpService.java16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/org/codeaurora/bluetooth/ftp/BluetoothFtpService.java b/src/org/codeaurora/bluetooth/ftp/BluetoothFtpService.java
index 5d16d65..c231e41 100644
--- a/src/org/codeaurora/bluetooth/ftp/BluetoothFtpService.java
+++ b/src/org/codeaurora/bluetooth/ftp/BluetoothFtpService.java
@@ -404,12 +404,6 @@ public class BluetoothFtpService extends Service {
VERBOSE = Log.isLoggable(BluetoothFtpService.LOG_TAG, Log.VERBOSE) ? true : false;
Log.v(TAG, "Ftp Service startRfcommSocketListener");
- if (mRfcommServerSocket == null) {
- if (!initRfcommSocket()) {
- closeService();
- return;
- }
- }
if (mRfcommAcceptThread == null) {
mRfcommAcceptThread = new RfcommSocketAcceptThread();
mRfcommAcceptThread.setName("BluetoothFtpRfcommAcceptThread");
@@ -425,7 +419,7 @@ public class BluetoothFtpService extends Service {
// It's possible that create will fail in some cases. retry for 10 times
for (int i = 0; i < CREATE_RETRY_TIME && !mInterrupted; i++) {
try {
- // It is mandatory for PSE to support initiation of bonding and
+ // It is mandatory for FTP to support initiation of bonding and
// encryption.
mRfcommServerSocket = mAdapter.listenUsingRfcommWithServiceRecord("OBEX File Transfer", FileTransfer.getUuid());
initSocketOK = true;
@@ -645,6 +639,14 @@ public class BluetoothFtpService extends Service {
@Override
public void run() {
+
+ if (mRfcommServerSocket == null) {
+ if (!initRfcommSocket()) {
+ closeService();
+ return;
+ }
+ }
+
while (!stopped && mRfcommServerSocket != null) {
try {
Log.v(RTAG,"Run Accept thread");