Merge "Fix connecting to profiles when bonding from local device (3/3)"
diff --git a/src/com/android/nfc/handover/BluetoothPeripheralHandover.java b/src/com/android/nfc/handover/BluetoothPeripheralHandover.java
index 766afbb..ff2e1fb 100644
--- a/src/com/android/nfc/handover/BluetoothPeripheralHandover.java
+++ b/src/com/android/nfc/handover/BluetoothPeripheralHandover.java
@@ -326,17 +326,7 @@
                 // HFP then A2DP connect
                 mState = STATE_CONNECTING;
                 synchronized (mLock) {
-                    if (mTransport == BluetoothDevice.TRANSPORT_LE) {
-                        if (mInput.getConnectionState(mDevice)
-                                != BluetoothProfile.STATE_CONNECTED) {
-                            mHidResult = RESULT_PENDING;
-                            mInput.connect(mDevice);
-                            toast(getToastString(R.string.connecting_peripheral));
-                            break;
-                        } else {
-                            mHidResult = RESULT_CONNECTED;
-                        }
-                    } else {
+                    if (mTransport != BluetoothDevice.TRANSPORT_LE) {
                         if (mHeadset.getConnectionState(mDevice) !=
                                 BluetoothProfile.STATE_CONNECTED) {
                             mHfpResult = RESULT_PENDING;
@@ -358,18 +348,7 @@
                 }
                 // fall-through
             case STATE_CONNECTING:
-                if (mTransport == BluetoothDevice.TRANSPORT_LE) {
-                    if (mHidResult == RESULT_PENDING) {
-                        break;
-                    } else if (mHidResult == RESULT_CONNECTED) {
-                        toast(getToastString(R.string.connected_peripheral));
-                        mDevice.setAlias(mName);
-                        complete(true);
-                    } else {
-                        toast (getToastString(R.string.connect_peripheral_failed));
-                        complete(false);
-                    }
-                } else {
+                if (mTransport != BluetoothDevice.TRANSPORT_LE) {
                     if (mA2dpResult == RESULT_PENDING || mHfpResult == RESULT_PENDING) {
                         // another connection type still pending
                         break;