Loading src/com/android/settings/bluetooth/BluetoothPairingController.java +5 −16 Original line number Original line Diff line number Diff line Loading @@ -294,8 +294,7 @@ public class BluetoothPairingController implements OnCheckedChangeListener, if (mType == BluetoothDevice.PAIRING_VARIANT_DISPLAY_PASSKEY) { if (mType == BluetoothDevice.PAIRING_VARIANT_DISPLAY_PASSKEY) { mDevice.setPairingConfirmation(true); mDevice.setPairingConfirmation(true); } else if (mType == BluetoothDevice.PAIRING_VARIANT_DISPLAY_PIN) { } else if (mType == BluetoothDevice.PAIRING_VARIANT_DISPLAY_PIN) { byte[] pinBytes = BluetoothDevice.convertPinToBytes(mPasskeyFormatted); mDevice.setPin(mPasskeyFormatted); mDevice.setPin(pinBytes); } } } } Loading Loading @@ -391,17 +390,9 @@ public class BluetoothPairingController implements OnCheckedChangeListener, switch (mType) { switch (mType) { case BluetoothDevice.PAIRING_VARIANT_PIN: case BluetoothDevice.PAIRING_VARIANT_PIN: case BluetoothDevice.PAIRING_VARIANT_PIN_16_DIGITS: case BluetoothDevice.PAIRING_VARIANT_PIN_16_DIGITS: byte[] pinBytes = BluetoothDevice.convertPinToBytes(passkey); mDevice.setPin(passkey); if (pinBytes == null) { return; } mDevice.setPin(pinBytes); break; break; case BluetoothDevice.PAIRING_VARIANT_PASSKEY: int pass = Integer.parseInt(passkey); mDevice.setPasskey(pass); break; case BluetoothDevice.PAIRING_VARIANT_PASSKEY_CONFIRMATION: case BluetoothDevice.PAIRING_VARIANT_PASSKEY_CONFIRMATION: case BluetoothDevice.PAIRING_VARIANT_CONSENT: case BluetoothDevice.PAIRING_VARIANT_CONSENT: Loading @@ -410,11 +401,9 @@ public class BluetoothPairingController implements OnCheckedChangeListener, case BluetoothDevice.PAIRING_VARIANT_DISPLAY_PASSKEY: case BluetoothDevice.PAIRING_VARIANT_DISPLAY_PASSKEY: case BluetoothDevice.PAIRING_VARIANT_DISPLAY_PIN: case BluetoothDevice.PAIRING_VARIANT_DISPLAY_PIN: // Do nothing. break; case BluetoothDevice.PAIRING_VARIANT_OOB_CONSENT: case BluetoothDevice.PAIRING_VARIANT_OOB_CONSENT: mDevice.setRemoteOutOfBandData(); case BluetoothDevice.PAIRING_VARIANT_PASSKEY: // Do nothing. break; break; default: default: Loading @@ -428,7 +417,7 @@ public class BluetoothPairingController implements OnCheckedChangeListener, */ */ public void onCancel() { public void onCancel() { Log.d(TAG, "Pairing dialog canceled"); Log.d(TAG, "Pairing dialog canceled"); mDevice.cancelPairingUserInput(); mDevice.cancelPairing(); } } /** /** Loading src/com/android/settings/bluetooth/BluetoothPairingService.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -85,7 +85,7 @@ public final class BluetoothPairingService extends Service { } else if (action.equals(ACTION_DISMISS_PAIRING)) { } else if (action.equals(ACTION_DISMISS_PAIRING)) { Log.d(TAG, "Notification cancel " + mDevice.getAddress() + " (" + Log.d(TAG, "Notification cancel " + mDevice.getAddress() + " (" + mDevice.getName() + ")"); mDevice.getName() + ")"); mDevice.cancelPairingUserInput(); mDevice.cancelPairing(); } else { } else { int bondState = intent.getIntExtra(BluetoothDevice.EXTRA_BOND_STATE, int bondState = intent.getIntExtra(BluetoothDevice.EXTRA_BOND_STATE, BluetoothDevice.ERROR); BluetoothDevice.ERROR); Loading Loading
src/com/android/settings/bluetooth/BluetoothPairingController.java +5 −16 Original line number Original line Diff line number Diff line Loading @@ -294,8 +294,7 @@ public class BluetoothPairingController implements OnCheckedChangeListener, if (mType == BluetoothDevice.PAIRING_VARIANT_DISPLAY_PASSKEY) { if (mType == BluetoothDevice.PAIRING_VARIANT_DISPLAY_PASSKEY) { mDevice.setPairingConfirmation(true); mDevice.setPairingConfirmation(true); } else if (mType == BluetoothDevice.PAIRING_VARIANT_DISPLAY_PIN) { } else if (mType == BluetoothDevice.PAIRING_VARIANT_DISPLAY_PIN) { byte[] pinBytes = BluetoothDevice.convertPinToBytes(mPasskeyFormatted); mDevice.setPin(mPasskeyFormatted); mDevice.setPin(pinBytes); } } } } Loading Loading @@ -391,17 +390,9 @@ public class BluetoothPairingController implements OnCheckedChangeListener, switch (mType) { switch (mType) { case BluetoothDevice.PAIRING_VARIANT_PIN: case BluetoothDevice.PAIRING_VARIANT_PIN: case BluetoothDevice.PAIRING_VARIANT_PIN_16_DIGITS: case BluetoothDevice.PAIRING_VARIANT_PIN_16_DIGITS: byte[] pinBytes = BluetoothDevice.convertPinToBytes(passkey); mDevice.setPin(passkey); if (pinBytes == null) { return; } mDevice.setPin(pinBytes); break; break; case BluetoothDevice.PAIRING_VARIANT_PASSKEY: int pass = Integer.parseInt(passkey); mDevice.setPasskey(pass); break; case BluetoothDevice.PAIRING_VARIANT_PASSKEY_CONFIRMATION: case BluetoothDevice.PAIRING_VARIANT_PASSKEY_CONFIRMATION: case BluetoothDevice.PAIRING_VARIANT_CONSENT: case BluetoothDevice.PAIRING_VARIANT_CONSENT: Loading @@ -410,11 +401,9 @@ public class BluetoothPairingController implements OnCheckedChangeListener, case BluetoothDevice.PAIRING_VARIANT_DISPLAY_PASSKEY: case BluetoothDevice.PAIRING_VARIANT_DISPLAY_PASSKEY: case BluetoothDevice.PAIRING_VARIANT_DISPLAY_PIN: case BluetoothDevice.PAIRING_VARIANT_DISPLAY_PIN: // Do nothing. break; case BluetoothDevice.PAIRING_VARIANT_OOB_CONSENT: case BluetoothDevice.PAIRING_VARIANT_OOB_CONSENT: mDevice.setRemoteOutOfBandData(); case BluetoothDevice.PAIRING_VARIANT_PASSKEY: // Do nothing. break; break; default: default: Loading @@ -428,7 +417,7 @@ public class BluetoothPairingController implements OnCheckedChangeListener, */ */ public void onCancel() { public void onCancel() { Log.d(TAG, "Pairing dialog canceled"); Log.d(TAG, "Pairing dialog canceled"); mDevice.cancelPairingUserInput(); mDevice.cancelPairing(); } } /** /** Loading
src/com/android/settings/bluetooth/BluetoothPairingService.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -85,7 +85,7 @@ public final class BluetoothPairingService extends Service { } else if (action.equals(ACTION_DISMISS_PAIRING)) { } else if (action.equals(ACTION_DISMISS_PAIRING)) { Log.d(TAG, "Notification cancel " + mDevice.getAddress() + " (" + Log.d(TAG, "Notification cancel " + mDevice.getAddress() + " (" + mDevice.getName() + ")"); mDevice.getName() + ")"); mDevice.cancelPairingUserInput(); mDevice.cancelPairing(); } else { } else { int bondState = intent.getIntExtra(BluetoothDevice.EXTRA_BOND_STATE, int bondState = intent.getIntExtra(BluetoothDevice.EXTRA_BOND_STATE, BluetoothDevice.ERROR); BluetoothDevice.ERROR); Loading