From 02d9c106fe98757768eb8c8d11f3afbda52a6c9d Mon Sep 17 00:00:00 2001 From: Ajay Kumar Date: Wed, 6 Jan 2016 19:27:39 +0530 Subject: 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 --- src/com/android/bluetooth/opp/BluetoothOppService.java | 5 +++-- 1 file 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"); -- cgit v1.2.3