Fix Bluetooth pairing dialogue crash
am: e51972868c
Change-Id: I15e2263b5907f10f385d07e2797b43240e2eed65
This commit is contained in:
@@ -96,6 +96,7 @@ public final class BluetoothPairingDialog extends AlertActivity implements
|
|||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
mReceiverRegistered = false;
|
||||||
|
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
if (!intent.getAction().equals(BluetoothDevice.ACTION_PAIRING_REQUEST)) {
|
if (!intent.getAction().equals(BluetoothDevice.ACTION_PAIRING_REQUEST)) {
|
||||||
@@ -129,6 +130,8 @@ public final class BluetoothPairingDialog extends AlertActivity implements
|
|||||||
intent.getIntExtra(BluetoothDevice.EXTRA_PAIRING_KEY, BluetoothDevice.ERROR);
|
intent.getIntExtra(BluetoothDevice.EXTRA_PAIRING_KEY, BluetoothDevice.ERROR);
|
||||||
if (passkey == BluetoothDevice.ERROR) {
|
if (passkey == BluetoothDevice.ERROR) {
|
||||||
Log.e(TAG, "Invalid Confirmation Passkey received, not showing any dialog");
|
Log.e(TAG, "Invalid Confirmation Passkey received, not showing any dialog");
|
||||||
|
mDevice.setPairingConfirmation(false);
|
||||||
|
finish();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mPairingKey = String.format(Locale.US, "%06d", passkey);
|
mPairingKey = String.format(Locale.US, "%06d", passkey);
|
||||||
@@ -146,6 +149,7 @@ public final class BluetoothPairingDialog extends AlertActivity implements
|
|||||||
intent.getIntExtra(BluetoothDevice.EXTRA_PAIRING_KEY, BluetoothDevice.ERROR);
|
intent.getIntExtra(BluetoothDevice.EXTRA_PAIRING_KEY, BluetoothDevice.ERROR);
|
||||||
if (pairingKey == BluetoothDevice.ERROR) {
|
if (pairingKey == BluetoothDevice.ERROR) {
|
||||||
Log.e(TAG, "Invalid Confirmation Passkey or PIN received, not showing any dialog");
|
Log.e(TAG, "Invalid Confirmation Passkey or PIN received, not showing any dialog");
|
||||||
|
finish();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (mType == BluetoothDevice.PAIRING_VARIANT_DISPLAY_PASSKEY) {
|
if (mType == BluetoothDevice.PAIRING_VARIANT_DISPLAY_PASSKEY) {
|
||||||
@@ -158,6 +162,8 @@ public final class BluetoothPairingDialog extends AlertActivity implements
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
Log.e(TAG, "Incorrect pairing type received, not showing any dialog");
|
Log.e(TAG, "Incorrect pairing type received, not showing any dialog");
|
||||||
|
finish();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user