Loading src/com/android/bluetooth/btservice/BondStateMachine.java +9 −3 Original line number Diff line number Diff line Loading @@ -64,6 +64,9 @@ final class BondStateMachine extends StateMachine { private PendingCommandState mPendingCommandState = new PendingCommandState(); private StableState mStableState = new StableState(); private final ArrayList<BluetoothDevice> mDevices = new ArrayList<BluetoothDevice>(); private BondStateMachine(AdapterService service, AdapterProperties prop, RemoteDevices remoteDevices) { super("BondStateMachine:"); Loading Loading @@ -118,6 +121,9 @@ final class BondStateMachine extends StateMachine { /* if incoming pairing, transition to pending state */ if (newState == BluetoothDevice.BOND_BONDING) { if(!mDevices.contains(dev)) { mDevices.add(dev); } sendIntent(dev, newState, 0); transitionTo(mPendingCommandState); } Loading @@ -138,8 +144,6 @@ final class BondStateMachine extends StateMachine { private class PendingCommandState extends State { private final ArrayList<BluetoothDevice> mDevices = new ArrayList<BluetoothDevice>(); @Override public void enter() { Loading Loading @@ -177,7 +181,9 @@ final class BondStateMachine extends StateMachine { // check if bond none is received from device which // was in pairing state otherwise don't transition to // stable state. if (newState == BluetoothDevice.BOND_NONE && !mDevices.contains(dev)) { if (newState == BluetoothDevice.BOND_NONE && !mDevices.contains(dev) && mDevices.size() != 0) { infoLog("not transitioning to stable state"); break; } /* this is either none/bonded, remove and transition */ Loading Loading
src/com/android/bluetooth/btservice/BondStateMachine.java +9 −3 Original line number Diff line number Diff line Loading @@ -64,6 +64,9 @@ final class BondStateMachine extends StateMachine { private PendingCommandState mPendingCommandState = new PendingCommandState(); private StableState mStableState = new StableState(); private final ArrayList<BluetoothDevice> mDevices = new ArrayList<BluetoothDevice>(); private BondStateMachine(AdapterService service, AdapterProperties prop, RemoteDevices remoteDevices) { super("BondStateMachine:"); Loading Loading @@ -118,6 +121,9 @@ final class BondStateMachine extends StateMachine { /* if incoming pairing, transition to pending state */ if (newState == BluetoothDevice.BOND_BONDING) { if(!mDevices.contains(dev)) { mDevices.add(dev); } sendIntent(dev, newState, 0); transitionTo(mPendingCommandState); } Loading @@ -138,8 +144,6 @@ final class BondStateMachine extends StateMachine { private class PendingCommandState extends State { private final ArrayList<BluetoothDevice> mDevices = new ArrayList<BluetoothDevice>(); @Override public void enter() { Loading Loading @@ -177,7 +181,9 @@ final class BondStateMachine extends StateMachine { // check if bond none is received from device which // was in pairing state otherwise don't transition to // stable state. if (newState == BluetoothDevice.BOND_NONE && !mDevices.contains(dev)) { if (newState == BluetoothDevice.BOND_NONE && !mDevices.contains(dev) && mDevices.size() != 0) { infoLog("not transitioning to stable state"); break; } /* this is either none/bonded, remove and transition */ Loading