summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/java/android/server/BluetoothBondState.java8
-rwxr-xr-xcore/java/android/server/BluetoothService.java2
2 files changed, 7 insertions, 3 deletions
diff --git a/core/java/android/server/BluetoothBondState.java b/core/java/android/server/BluetoothBondState.java
index 5fa8836c1d9c..76e78858e029 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 7f47ebcbcc90..b5ae298f36e6 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.