diff options
author | Ajay Kumar <ajayku@codeaurora.org> | 2016-01-06 19:27:39 +0530 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2016-06-15 16:59:10 -0700 |
commit | 084c841f761ecb89eb1654f2abdfe161a6ecc042 (patch) | |
tree | 6597e4667ee059a20bebd97aa6a5b8401abefd83 | |
parent | 54060ad6a36a4a2bcfe6fb0866ebb1d81cc9546d (diff) | |
download | android_packages_apps_Bluetooth-084c841f761ecb89eb1654f2abdfe161a6ecc042.tar.gz android_packages_apps_Bluetooth-084c841f761ecb89eb1654f2abdfe161a6ecc042.tar.bz2 android_packages_apps_Bluetooth-084c841f761ecb89eb1654f2abdfe161a6ecc042.zip |
Bluetooth: Using the eventHandler to start listener
if the intent is delayed we are directly calling
the listener which is not dynamically checking the
current state of adapter.This might create issue
if we recieve this intent when BT is not in ON
State.Eventhandler is already having this check
so using eventhandler instead of direct call.
CYNGNOS-2866
Crs-Fixed: 956092
Change-Id: Ie5331a180f1d74e5843d5b25ded69466e0b59635
(cherry picked from commit 02d9c106fe98757768eb8c8d11f3afbda52a6c9d)
-rw-r--r-- | src/com/android/bluetooth/opp/BluetoothOppService.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/com/android/bluetooth/opp/BluetoothOppService.java b/src/com/android/bluetooth/opp/BluetoothOppService.java index c70d0fe17..4edf4dd7a 100644 --- a/src/com/android/bluetooth/opp/BluetoothOppService.java +++ b/src/com/android/bluetooth/opp/BluetoothOppService.java @@ -432,8 +432,9 @@ public class BluetoothOppService extends Service { if (action.equals(BluetoothAdapter.ACTION_STATE_CHANGED)) { switch (intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.ERROR)) { case BluetoothAdapter.STATE_ON: - Log.d(TAG, "Receiver BLUETOOTH_STATE_CHANGED_ACTION, STATE_ON"); - startSocketListener(); + if (V) Log.v(TAG, + "Receiver BLUETOOTH_STATE_CHANGED_ACTION, BLUETOOTH_STATE_ON"); + mHandler.sendMessage(mHandler.obtainMessage(START_LISTENER)); break; case BluetoothAdapter.STATE_TURNING_OFF: Log.d(TAG, "Receiver BLUETOOTH_STATE_CHANGED_ACTION, STATE_TURNING_OFF"); |