diff options
author | Hemant Gupta <hemantg@codeaurora.org> | 2014-11-10 12:49:26 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2014-11-09 23:22:47 -0800 |
commit | 54b9efa08d305293278bd391cca79e4a66ff7e7c (patch) | |
tree | 3e9e4d1d2b0be8ef2e5d69328314b66d8b389a19 | |
parent | 23872771fd7eb5c69199829261041d8ecf3a85ed (diff) | |
download | android_packages_apps_BluetoothExt-54b9efa08d305293278bd391cca79e4a66ff7e7c.tar.gz android_packages_apps_BluetoothExt-54b9efa08d305293278bd391cca79e4a66ff7e7c.tar.bz2 android_packages_apps_BluetoothExt-54b9efa08d305293278bd391cca79e4a66ff7e7c.zip |
FTP: Update isWaitingAuthorization as FALSE when user presses cancel
This patch updtes the value of isWaitingAuthorization to FALSE when user
presses cancel. Without this, authorization state was not correct in
timeout, and cancel scenarios leading to authorization popup not being
received at ftp layer which prevented new FTP connection until BT off and on
was done
CRs-Fixed: 753197
Change-Id: I685fdcc7aba54d3954c8a99a7fbe86e2da2e7773
-rw-r--r-- | src/org/codeaurora/bluetooth/ftp/BluetoothFtpService.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/org/codeaurora/bluetooth/ftp/BluetoothFtpService.java b/src/org/codeaurora/bluetooth/ftp/BluetoothFtpService.java index 164aa4a..cd2f583 100644 --- a/src/org/codeaurora/bluetooth/ftp/BluetoothFtpService.java +++ b/src/org/codeaurora/bluetooth/ftp/BluetoothFtpService.java @@ -83,7 +83,7 @@ public class BluetoothFtpService extends Service { //public static final boolean VERBOSE = false; public static final boolean DEBUG = true; - public static boolean VERBOSE; + public static boolean VERBOSE = true; private int mState; /** @@ -314,6 +314,7 @@ public class BluetoothFtpService extends Service { } else if (action.equals(ACCESS_ALLOWED_ACTION)) { if (!isWaitingAuthorization) { // this reply is not for us + if (VERBOSE) Log.v(TAG, "isWaitingAuthorization = " + isWaitingAuthorization); return; } @@ -336,6 +337,8 @@ public class BluetoothFtpService extends Service { } removeFtpNotification(NOTIFICATION_ID_ACCESS); } else if (action.equals(ACCESS_DISALLOWED_ACTION)) { + if (VERBOSE) Log.v(TAG, "ACCESS_DISALLOWED_ACTION"); + isWaitingAuthorization = false; stopObexServerSession(); } else if (action.equals(AUTH_RESPONSE_ACTION)) { String sessionkey = intent.getStringExtra(EXTRA_SESSION_KEY); @@ -528,6 +531,7 @@ public class BluetoothFtpService extends Service { if (VERBOSE) Log.v(TAG, "Ftp Service stopObexServerSession"); if (mServerSession != null) { + if (VERBOSE) Log.v(TAG, "stopObexServerSession, closing mServerSession"); mServerSession.close(); mServerSession = null; } @@ -535,6 +539,7 @@ public class BluetoothFtpService extends Service { mRfcommAcceptThread = null; try { + if (VERBOSE) Log.v(TAG, "stopObexServerSession, closeRfcommSocket"); closeRfcommSocket(false, true); } catch (IOException e) { Log.e(TAG, "closeSocket error: " + e.toString()); @@ -542,6 +547,7 @@ public class BluetoothFtpService extends Service { // Last obex transaction is finished, we start to listen for incoming // connection again if (mAdapter.isEnabled()) { + if (VERBOSE) Log.v(TAG, "stopObexServerSession, startRfcommSocketListener"); startRfcommSocketListener(); } } |