Merge change 23699 into eclair

* changes:
  b/2045917 Fixed the problem where Bluetooth enable/disable remain disabled when Airplane mode is turned off.
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 2af9b18..a73f910 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -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 -->
diff --git a/src/com/android/settings/bluetooth/BluetoothPairingDialog.java b/src/com/android/settings/bluetooth/BluetoothPairingDialog.java
index 1e0da90..ac5dfba 100644
--- a/src/com/android/settings/bluetooth/BluetoothPairingDialog.java
+++ b/src/com/android/settings/bluetooth/BluetoothPairingDialog.java
@@ -53,7 +53,7 @@
     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 @@
         } 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");