diff options
author | Andres Morales <anmorales@google.com> | 2014-09-16 13:19:44 -0700 |
---|---|---|
committer | Andres Morales <anmorales@google.com> | 2014-10-02 23:14:22 +0000 |
commit | c6204dc79ac89d30e20cc39f139ee10dd304de7f (patch) | |
tree | 313fb148ed68c2712f7260138d83191a9c2f623a | |
parent | fb890c0332437575e39cb256c861912f0f9ff386 (diff) | |
download | android_packages_apps_Nfc-c6204dc79ac89d30e20cc39f139ee10dd304de7f.tar.gz android_packages_apps_Nfc-c6204dc79ac89d30e20cc39f139ee10dd304de7f.tar.bz2 android_packages_apps_Nfc-c6204dc79ac89d30e20cc39f139ee10dd304de7f.zip |
Set BT device alias from NFC tag
Bug: 17409874
Change-Id: I9a638601507ba51fe861cd8c62366c61f6210dec
-rw-r--r-- | src/com/android/nfc/handover/BluetoothPeripheralHandover.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/com/android/nfc/handover/BluetoothPeripheralHandover.java b/src/com/android/nfc/handover/BluetoothPeripheralHandover.java index 39dcf81f..24bd9e5e 100644 --- a/src/com/android/nfc/handover/BluetoothPeripheralHandover.java +++ b/src/com/android/nfc/handover/BluetoothPeripheralHandover.java @@ -294,6 +294,7 @@ public class BluetoothPeripheralHandover implements BluetoothProfile.ServiceList void nextStepConnect() { switch (mState) { case STATE_INIT_COMPLETE: + if (mDevice.getBondState() != BluetoothDevice.BOND_BONDED) { requestPairConfirmation(); mState = STATE_WAITING_FOR_BOND_CONFIRMATION; @@ -359,6 +360,7 @@ public class BluetoothPeripheralHandover implements BluetoothProfile.ServiceList break; } else if (mHidResult == RESULT_CONNECTED) { toast(mContext.getString(R.string.connected_peripheral) + " " + mName); + mDevice.setAlias(mName); complete(true); } else { toast (mContext.getString(R.string.connect_peripheral_failed) + " " @@ -374,6 +376,7 @@ public class BluetoothPeripheralHandover implements BluetoothProfile.ServiceList // we'll take either as success toast(mContext.getString(R.string.connected_peripheral) + " " + mName); if (mA2dpResult == RESULT_CONNECTED) startTheMusic(); + mDevice.setAlias(mName); complete(true); } else { toast (mContext.getString(R.string.connect_peripheral_failed) + " " + mName); |