diff options
| author | Matthew Xie <mattx@google.com> | 2012-05-07 11:01:23 -0700 |
|---|---|---|
| committer | Matthew Xie <mattx@google.com> | 2012-05-07 11:01:23 -0700 |
| commit | b12d6bc3a561e7a8ce136126474c75bd71ae2f81 (patch) | |
| tree | 6070f7f06ebca97246621e435d6a3496d6f59df3 /core/java/android/server/BluetoothService.java | |
| parent | e06747c727c9edc05c1d32f389a2347a11f653d5 (diff) | |
| download | frameworks_base-b12d6bc3a561e7a8ce136126474c75bd71ae2f81.zip frameworks_base-b12d6bc3a561e7a8ce136126474c75bd71ae2f81.tar.gz frameworks_base-b12d6bc3a561e7a8ce136126474c75bd71ae2f81.tar.bz2 | |
When turning off, broadcast STATE_OFF in the last HotOff state
This is because we do HotOff -> PowerOff -> HotOff for USER_TURN_OFF
Donot do poweroff for perprocess turn off.
Add small time delays for calls into stack to reset dbus timing.
bug 6438556
Change-Id: Iae8bdd24e41824ed4bc34aca96d082f9284f169c
Diffstat (limited to 'core/java/android/server/BluetoothService.java')
| -rwxr-xr-x | core/java/android/server/BluetoothService.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/core/java/android/server/BluetoothService.java b/core/java/android/server/BluetoothService.java index a420734..3cf207f 100755 --- a/core/java/android/server/BluetoothService.java +++ b/core/java/android/server/BluetoothService.java @@ -526,6 +526,12 @@ public class BluetoothService extends IBluetooth.Stub { return false; } switchConnectable(false); + + // Bluetooth stack needs a small delay here before adding + // SDP records, otherwise dbus stalls for over 30 seconds 1 out of 50 runs + try { + Thread.sleep(20); + } catch (InterruptedException e) {} updateSdpRecords(); return true; } @@ -593,6 +599,12 @@ public class BluetoothService extends IBluetooth.Stub { // Add SDP records for profiles maintained by Android userspace addReservedSdpRecords(uuids); + // Bluetooth stack need some a small delay here before adding more + // SDP records, otherwise dbus stalls for over 30 seconds 1 out of 50 runs + try { + Thread.sleep(20); + } catch (InterruptedException e) {} + if (R.getBoolean(com.android.internal.R.bool.config_bluetooth_default_profiles)) { // Enable profiles maintained by Bluez userspace. setBluetoothTetheringNative(true, BluetoothPanProfileHandler.NAP_ROLE, |
