b/2050798 Bluetooth Passkeys should always be 6 digits so show leading zeros if needed.
Removed extra new lines in the passkey and pin dialogs because the string didn't fit in landscape mode. (scrollbars to appeared)
This commit is contained in:
@@ -513,11 +513,11 @@
|
||||
<!-- Title for the bluetooth device info screen. -->
|
||||
<string name="bluetooth_device_info">Bluetooth device info</string>
|
||||
<!-- Message when bluetooth dialog for pin entry is showing -->
|
||||
<string name="bluetooth_enter_pin_msg"><xliff:g id="device_name">%1$s</xliff:g>\n\nType PIN to pair.\n(Try 0000 or 1234.)</string>
|
||||
<string name="bluetooth_enter_pin_msg"><xliff:g id="device_name">%1$s</xliff:g>\nType PIN to pair.\n(Try 0000 or 1234.)</string>
|
||||
<!-- Message when bluetooth dialog for passkey entry is showing -->
|
||||
<string name="bluetooth_enter_passkey_msg"><xliff:g id="device_name">%1$s</xliff:g>\n\nType passkey to pair.\n</string>
|
||||
<string name="bluetooth_enter_passkey_msg"><xliff:g id="device_name">%1$s</xliff:g>\nType passkey to pair.\n</string>
|
||||
<!-- Message when bluetooth dialog for confirmation of passkey is showing -->
|
||||
<string name="bluetooth_confirm_passkey_msg">To pair with \u0022<xliff:g id="device_name">%1$s</xliff:g>\u0022, confirm that it is showing the passkey: <xliff:g id="passkey">%2$d</xliff:g>.</string>
|
||||
<string name="bluetooth_confirm_passkey_msg">To pair with \u0022<xliff:g id="device_name">%1$s</xliff:g>\u0022, confirm that it is showing the passkey: <xliff:g id="passkey">%2$s</xliff:g>.</string>
|
||||
<!-- Button text for accepting an incoming pairing request -->
|
||||
<string name="bluetooth_pairing_accept">Pair</string>
|
||||
<!-- Button text for declining an incoming pairing request -->
|
||||
|
@@ -53,7 +53,7 @@ public class BluetoothPairingDialog extends AlertActivity implements DialogInter
|
||||
private LocalBluetoothManager mLocalManager;
|
||||
private BluetoothDevice mDevice;
|
||||
private int mType;
|
||||
private int mConfirmationPasskey;
|
||||
private String mConfirmationPasskey;
|
||||
private EditText mPairingView;
|
||||
private Button mOkButton;
|
||||
|
||||
@@ -95,12 +95,13 @@ public class BluetoothPairingDialog extends AlertActivity implements DialogInter
|
||||
} else if (mType == BluetoothDevice.PAIRING_VARIANT_PASSKEY) {
|
||||
createUserEntryDialog();
|
||||
} else if (mType == BluetoothDevice.PAIRING_VARIANT_CONFIRMATION){
|
||||
mConfirmationPasskey =
|
||||
int passkey =
|
||||
intent.getIntExtra(BluetoothIntent.PASSKEY, BluetoothClass.ERROR);
|
||||
if (mConfirmationPasskey == BluetoothClass.ERROR) {
|
||||
if (passkey == BluetoothClass.ERROR) {
|
||||
Log.e(TAG, "Invalid ConfirmationPasskey received, not showing any dialog");
|
||||
return;
|
||||
}
|
||||
mConfirmationPasskey = String.format("%06d", passkey);
|
||||
createConfirmationDialog();
|
||||
} else {
|
||||
Log.e(TAG, "Incorrect pairing type received, not showing any dialog");
|
||||
|
Reference in New Issue
Block a user