diff options
author | Staffan Lindvall <staffan.lindvall.x@sonyericsson.com> | 2010-10-27 10:34:53 +0200 |
---|---|---|
committer | Steve Kondik <shade@chemlab.org> | 2010-11-21 04:23:20 -0500 |
commit | dfc114951071cdaf509539453c26aaa25cb7b393 (patch) | |
tree | dc16d20a6ac371692b215f2adbfc2c5b8a4bb88c /core | |
parent | 78a97b98a8e53c9b1b808f6011b86621f4918bfe (diff) | |
download | frameworks_base-dfc114951071cdaf509539453c26aaa25cb7b393.zip frameworks_base-dfc114951071cdaf509539453c26aaa25cb7b393.tar.gz frameworks_base-dfc114951071cdaf509539453c26aaa25cb7b393.tar.bz2 |
Phone crash when old callback func is woken up when enabling BT.
When the remote Jerry device is powered down the BT link to the
phone is dropped, and the Jerry firmware in the phone quite
immediately tries to re-connect to the Jerry device. Then
SDP and Discover Services is started, fetchRemoteUuids() ->
discoverServicesNative(). This results in an asynchronous dbus
call dbus_func_args_async() that is provided with a callback
function, onDiscoverServicesResult(), but before this callback
function is used Bluetooth is disabled according to the problem
scenario above. For some reason this discover services activity
is not cleared when Bluetooth is disabled, so when Bluetooth
is enabled again the (old) callback function
onDiscoverServicesResult() is executed, but the following
getAddressFromObjectPath() fails. The reason for this is that
the deviceObjectPath parameter contains an old value,
containg the process id of the old bluetoothd (the one running
before Bluetooth was disabled). Then the new updated
AdapterObjectPath /org/bluez/<new bluetooth hd pid>/hci0/dev_
is not a prefix of the old deviceObjectPath /org/bluez/<old
bluetooth hd pid>/hci0/dev_<BT_ADDR>, which results in that null
will be used as address in sendUuidIntent(), and later on,
ending up in the BluetoothDevice constructor where and
IllegalArgumentExceotion is thrown due to
Bluetooth address = null. Then the phone will crash.
Making sure sendUuidIntent() is not called when address is null
is a work-around for the problem.
Change-Id: I8ff60bad80de3b379cef0970402943dfa4de3cfd
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/server/BluetoothEventLoop.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/java/android/server/BluetoothEventLoop.java b/core/java/android/server/BluetoothEventLoop.java index 1307c70..e9181f1 100644 --- a/core/java/android/server/BluetoothEventLoop.java +++ b/core/java/android/server/BluetoothEventLoop.java @@ -627,7 +627,9 @@ class BluetoothEventLoop { if (result) { mBluetoothService.updateRemoteDevicePropertiesCache(address); } - mBluetoothService.sendUuidIntent(address); + if (address != null) { + mBluetoothService.sendUuidIntent(address); + } mBluetoothService.makeServiceChannelCallbacks(address); } |