diff options
author | Scott Mertz <smertz@cyngn.com> | 2014-08-05 15:05:22 -0700 |
---|---|---|
committer | Scott Mertz <inwotep@cyngn.com> | 2014-08-06 00:38:09 +0000 |
commit | 3120fee12272150b745d52ec1ed7c30ab42833e6 (patch) | |
tree | 519c25fc18fed8919d6d22580433ff375b0e1f5b | |
parent | 3adb7b37925b83b147e4507201d89d4947c1dc42 (diff) | |
download | android_packages_apps_BluetoothExt-3120fee12272150b745d52ec1ed7c30ab42833e6.tar.gz android_packages_apps_BluetoothExt-3120fee12272150b745d52ec1ed7c30ab42833e6.tar.bz2 android_packages_apps_BluetoothExt-3120fee12272150b745d52ec1ed7c30ab42833e6.zip |
BluetoothExt: Fix BluetoothFtpService shutdown
- If the adapter transitions to STATE_OFF before the intent
is handled, the BluetoothFtpService won't shut down.
- Shut down the service if it's transitioning or already off
Bug: CYAN-4856
Change-Id: Id96fddaa443fe6b70eea880181b2d2fcc1d091de
-rw-r--r-- | src/org/codeaurora/bluetooth/ftp/BluetoothFtpService.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/org/codeaurora/bluetooth/ftp/BluetoothFtpService.java b/src/org/codeaurora/bluetooth/ftp/BluetoothFtpService.java index 96ddb05..f84c081 100644 --- a/src/org/codeaurora/bluetooth/ftp/BluetoothFtpService.java +++ b/src/org/codeaurora/bluetooth/ftp/BluetoothFtpService.java @@ -292,7 +292,8 @@ public class BluetoothFtpService extends Service { if (action.equals(BluetoothAdapter.ACTION_STATE_CHANGED)) { removeTimeoutMsg = false; if ((state == BluetoothAdapter.STATE_TURNING_OFF) && (mAdapter != null) - && (state == mAdapter.getState())) { + && (BluetoothAdapter.STATE_TURNING_OFF == mAdapter.getState() || + BluetoothAdapter.STATE_OFF == mAdapter.getState())) { /** Terminate file copy operation if it is in progress */ FileUtils.interruptFileCopy = true; // Send any pending timeout now, as this service will be destroyed. |