summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAjay Kumar <ajayku@codeaurora.org>2016-01-06 19:27:39 +0530
committerRoman Birg <roman@cyngn.com>2016-06-10 16:24:17 -0700
commit02d9c106fe98757768eb8c8d11f3afbda52a6c9d (patch)
treeb95c8775afba591ef45f1dfd32554090aa2faa75
parent5080b9b7293800b9f2be6887096f1eb54e1c55fc (diff)
downloadandroid_packages_apps_Bluetooth-02d9c106fe98757768eb8c8d11f3afbda52a6c9d.tar.gz
android_packages_apps_Bluetooth-02d9c106fe98757768eb8c8d11f3afbda52a6c9d.tar.bz2
android_packages_apps_Bluetooth-02d9c106fe98757768eb8c8d11f3afbda52a6c9d.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. Crs-Fixed: 956092 Change-Id: Ie5331a180f1d74e5843d5b25ded69466e0b59635
-rw-r--r--src/com/android/bluetooth/opp/BluetoothOppService.java5
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 cdc932ff0..bf1d60e29 100644
--- a/src/com/android/bluetooth/opp/BluetoothOppService.java
+++ b/src/com/android/bluetooth/opp/BluetoothOppService.java
@@ -413,8 +413,9 @@ public class BluetoothOppService extends Service {
if (action.equals(BluetoothAdapter.ACTION_STATE_CHANGED)) {
switch (mAdapter.getState()) {
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");