Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 531b95f1 authored by Jake Hamby's avatar Jake Hamby Committed by Android (Google) Code Review
Browse files

Merge "Fix crash while device is pairing / unpairing."

parents 32d56ee7 c73dd732
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -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) {
+1 −1
Original line number Diff line number Diff line
@@ -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.