From 55b0110fc298c403887b1311d7eabfffa230495f Mon Sep 17 00:00:00 2001 From: Jaikumar Ganesh Date: Mon, 19 Apr 2010 17:19:31 -0700 Subject: [PATCH] Fix runtime reboot when connecting to a A2DP headset and user toggles BT state. Bug:2607218 This happens when Bluetooth is turned off, and when the headset is still trying to connect. We get the connection result of attempt before Bluetooth was toggled. We need to ignore this result. Change-Id: I023406ec6d59880754ca4f1de676d0dce71b13c6 --- core/java/android/server/BluetoothA2dpService.java | 1 + core/jni/android_bluetooth_common.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/core/java/android/server/BluetoothA2dpService.java b/core/java/android/server/BluetoothA2dpService.java index 893db2e748c6f..ac89934ada603 100644 --- a/core/java/android/server/BluetoothA2dpService.java +++ b/core/java/android/server/BluetoothA2dpService.java @@ -554,6 +554,7 @@ public class BluetoothA2dpService extends IBluetoothA2dp.Stub { if (!result) { if (deviceObjectPath != null) { String address = mBluetoothService.getAddressFromObjectPath(deviceObjectPath); + if (address == null) return; BluetoothDevice device = mAdapter.getRemoteDevice(address); int state = getSinkState(device); handleSinkStateChange(device, state, BluetoothA2dp.STATE_DISCONNECTED); diff --git a/core/jni/android_bluetooth_common.cpp b/core/jni/android_bluetooth_common.cpp index 343fa53904af0..9a8f1b8881f1c 100644 --- a/core/jni/android_bluetooth_common.cpp +++ b/core/jni/android_bluetooth_common.cpp @@ -65,6 +65,7 @@ static Properties adapter_properties[] = { {"PairableTimeout", DBUS_TYPE_UINT32}, {"Discovering", DBUS_TYPE_BOOLEAN}, {"Devices", DBUS_TYPE_ARRAY}, + {"UUIDs", DBUS_TYPE_ARRAY}, }; typedef union {