From 8594394aadeaaa3f834d33d7b198fb071e0f31fe Mon Sep 17 00:00:00 2001 From: Matthew Xie Date: Fri, 29 Jul 2011 18:57:58 -0700 Subject: Move mBluetoothService.runBluetooth after broadcasting the STATE_ON intent. This is because broadcastState method move the Bluetooth adapter state to ON. The mBluetoothService.runBluetooth should be called only in the ON state. Remove mIsDiscovering variable in BluetoothService. Fix a bug in BluetoothA2dpService that caused 2 times of state change from DISCONNECTED to CONNECTING that messed up BluetoothService's connection state count. Change-Id: Ifb782a845ae70f007d2e036d930bb55f445d68b5 --- core/java/android/server/BluetoothEventLoop.java | 2 -- 1 file changed, 2 deletions(-) (limited to 'core/java/android/server/BluetoothEventLoop.java') diff --git a/core/java/android/server/BluetoothEventLoop.java b/core/java/android/server/BluetoothEventLoop.java index 9b9196a..3359bf9 100644 --- a/core/java/android/server/BluetoothEventLoop.java +++ b/core/java/android/server/BluetoothEventLoop.java @@ -359,12 +359,10 @@ class BluetoothEventLoop { Intent intent; adapterProperties.setProperty(name, propValues[1]); if (propValues[1].equals("true")) { - mBluetoothService.setIsDiscovering(true); intent = new Intent(BluetoothAdapter.ACTION_DISCOVERY_STARTED); } else { // Stop the discovery. mBluetoothService.cancelDiscovery(); - mBluetoothService.setIsDiscovering(false); intent = new Intent(BluetoothAdapter.ACTION_DISCOVERY_FINISHED); } mContext.sendBroadcast(intent, BLUETOOTH_PERM); -- cgit v1.1