diff options
author | Andres Morales <anmorales@google.com> | 2014-10-17 21:34:05 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-10-17 21:34:05 +0000 |
commit | 42102629aaa2b41342999c242c93fe657da5c927 (patch) | |
tree | 78054af8ffbf80fe7d2f777ce01d25a916e500f1 | |
parent | 1d9aa6fc65f69c2b01b3f3aeb8746bbf17da6e88 (diff) | |
parent | c6204dc79ac89d30e20cc39f139ee10dd304de7f (diff) | |
download | android_packages_apps_Nfc-42102629aaa2b41342999c242c93fe657da5c927.tar.gz android_packages_apps_Nfc-42102629aaa2b41342999c242c93fe657da5c927.tar.bz2 android_packages_apps_Nfc-42102629aaa2b41342999c242c93fe657da5c927.zip |
Merge "Set BT device alias from NFC tag" into lmp-mr1-dev
-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); |