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:
Michael Chan
2009-09-02 12:30:05 -07:00
parent 684736a9d4
commit 77395cc39c
2 changed files with 7 additions and 6 deletions

View File

@@ -513,11 +513,11 @@
<!-- Title for the bluetooth device info screen. --> <!-- Title for the bluetooth device info screen. -->
<string name="bluetooth_device_info">Bluetooth device info</string> <string name="bluetooth_device_info">Bluetooth device info</string>
<!-- Message when bluetooth dialog for pin entry is showing --> <!-- 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 --> <!-- 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 --> <!-- 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 --> <!-- Button text for accepting an incoming pairing request -->
<string name="bluetooth_pairing_accept">Pair</string> <string name="bluetooth_pairing_accept">Pair</string>
<!-- Button text for declining an incoming pairing request --> <!-- Button text for declining an incoming pairing request -->

View File

@@ -53,7 +53,7 @@ public class BluetoothPairingDialog extends AlertActivity implements DialogInter
private LocalBluetoothManager mLocalManager; private LocalBluetoothManager mLocalManager;
private BluetoothDevice mDevice; private BluetoothDevice mDevice;
private int mType; private int mType;
private int mConfirmationPasskey; private String mConfirmationPasskey;
private EditText mPairingView; private EditText mPairingView;
private Button mOkButton; private Button mOkButton;
@@ -95,12 +95,13 @@ public class BluetoothPairingDialog extends AlertActivity implements DialogInter
} else if (mType == BluetoothDevice.PAIRING_VARIANT_PASSKEY) { } else if (mType == BluetoothDevice.PAIRING_VARIANT_PASSKEY) {
createUserEntryDialog(); createUserEntryDialog();
} else if (mType == BluetoothDevice.PAIRING_VARIANT_CONFIRMATION){ } else if (mType == BluetoothDevice.PAIRING_VARIANT_CONFIRMATION){
mConfirmationPasskey = int passkey =
intent.getIntExtra(BluetoothIntent.PASSKEY, BluetoothClass.ERROR); intent.getIntExtra(BluetoothIntent.PASSKEY, BluetoothClass.ERROR);
if (mConfirmationPasskey == BluetoothClass.ERROR) { if (passkey == BluetoothClass.ERROR) {
Log.e(TAG, "Invalid ConfirmationPasskey received, not showing any dialog"); Log.e(TAG, "Invalid ConfirmationPasskey received, not showing any dialog");
return; return;
} }
mConfirmationPasskey = String.format("%06d", passkey);
createConfirmationDialog(); createConfirmationDialog();
} else { } else {
Log.e(TAG, "Incorrect pairing type received, not showing any dialog"); Log.e(TAG, "Incorrect pairing type received, not showing any dialog");