am 44fbf5a3: am 8e658ce5: Merge "Send vCard with Unicode encoded Strings over BT" into gingerbread

Merge commit '44fbf5a3537d1d701eedbd85e7115c36ef851c58'

* commit '44fbf5a3537d1d701eedbd85e7115c36ef851c58':
  Send vCard with Unicode encoded Strings over BT
diff --git a/src/com/android/bluetooth/pbap/BluetoothPbapVcardManager.java b/src/com/android/bluetooth/pbap/BluetoothPbapVcardManager.java
index dfcb0e6..29c64a8 100644
--- a/src/com/android/bluetooth/pbap/BluetoothPbapVcardManager.java
+++ b/src/com/android/bluetooth/pbap/BluetoothPbapVcardManager.java
@@ -535,16 +535,16 @@
             if (V) Log.v(TAG, "The length of this vcard is: " + vcardLen);
 
             mVcardResults.append(vcard);
-            int vcardStringLen = mVcardResults.toString().length();
-            if (V) Log.v(TAG, "The length of this vcardResults is: " + vcardStringLen);
+            int vcardByteLen = mVcardResults.toString().getBytes().length;
+            if (V) Log.v(TAG, "The byte length of this vcardResults is: " + vcardByteLen);
 
-            if (vcardStringLen >= maxPacketSize) {
+            if (vcardByteLen >= maxPacketSize) {
                 long timestamp = 0;
                 int position = 0;
 
                 // Need while loop to handle the big vcard case
                 while (!BluetoothPbapObexServer.sIsAborted
-                        && position < (vcardStringLen - maxPacketSize)) {
+                        && position < (vcardByteLen - maxPacketSize)) {
                     if (V) timestamp = System.currentTimeMillis();
 
                     String subStr = mVcardResults.toString().substring(position,
@@ -567,9 +567,9 @@
 
         public void onTerminate() {
             // Send out last packet
-            String lastStr = mVcardResults.toString();
+            byte[] lastBytes = mVcardResults.toString().getBytes();
             try {
-                outputStream.write(lastStr.getBytes(), 0, lastStr.length());
+                outputStream.write(lastBytes, 0, lastBytes.length);
             } catch (IOException e) {
                 Log.e(TAG, "write outputstrem failed" + e.toString());
             }