diff options
| author | Jaikumar Ganesh <jaikumar@google.com> | 2011-06-27 17:50:15 -0700 |
|---|---|---|
| committer | Jaikumar Ganesh <jaikumar@google.com> | 2011-06-27 17:55:32 -0700 |
| commit | c73dd732c962238330cc2e5538a88bffbbb40fe8 (patch) | |
| tree | 598a1034a8c61e0815d9e0dff9674dbe3fd60c01 /core/java/android | |
| parent | 7cec14235dcc5eaff5bcbcfe11f95dcf180b9a68 (diff) | |
| download | frameworks_base-c73dd732c962238330cc2e5538a88bffbbb40fe8.zip frameworks_base-c73dd732c962238330cc2e5538a88bffbbb40fe8.tar.gz frameworks_base-c73dd732c962238330cc2e5538a88bffbbb40fe8.tar.bz2 | |
Fix crash while device is pairing / unpairing.
When there are no paired devices, pairing a new device
will cause a crash since the profile proxies will be null.
Change-Id: Ie1a9fd198e46d7e9cc2ba1b2f3a806b3c709f568
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/server/BluetoothBondState.java | 8 | ||||
| -rwxr-xr-x | core/java/android/server/BluetoothService.java | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/core/java/android/server/BluetoothBondState.java b/core/java/android/server/BluetoothBondState.java index 5fa8836..76e7885 100644 --- a/core/java/android/server/BluetoothBondState.java +++ b/core/java/android/server/BluetoothBondState.java @@ -89,7 +89,12 @@ class BluetoothBondState { return mPendingOutgoingBonding; } - public synchronized void loadBondState() { + public synchronized void initBondState() { + getProfileProxy(); + loadBondState(); + } + + private void loadBondState() { if (mService.getBluetoothStateInternal() != BluetoothAdapter.STATE_TURNING_ON) { return; @@ -108,7 +113,6 @@ class BluetoothBondState { mState.put(mService.getAddressFromObjectPath(device).toUpperCase(), BluetoothDevice.BOND_BONDED); } - getProfileProxy(); } public synchronized void setBondState(String address, int state) { diff --git a/core/java/android/server/BluetoothService.java b/core/java/android/server/BluetoothService.java index 7f47ebc..b5ae298 100755 --- a/core/java/android/server/BluetoothService.java +++ b/core/java/android/server/BluetoothService.java @@ -570,7 +570,7 @@ public class BluetoothService extends IBluetooth.Stub { mIsDiscovering = false; mBondState.readAutoPairingData(); - mBondState.loadBondState(); + mBondState.initBondState(); initProfileState(); // This should be the last step of the the enable thread. |
