CYAN-3187: Bluetooth MAP SMS reciept sending entire phone number list
...from contact, confusing the car kit. Patch sends only the # that SMS came from.
Change-Id: I52edda4c93ba6cdfb4811d397671ed08c6c107a8
diff --git a/src/com/android/bluetooth/map/BluetoothMapContent.java b/src/com/android/bluetooth/map/BluetoothMapContent.java
index 9e623e2..9092174 100644
--- a/src/com/android/bluetooth/map/BluetoothMapContent.java
+++ b/src/com/android/bluetooth/map/BluetoothMapContent.java
@@ -2272,28 +2272,12 @@
}
p.close();
- // Bail out if we are unable to find a contact, based on the phone number
- if(contactId == null) {
- phoneNumbers = new String[1];
- phoneNumbers[0] = phone;
- }
- else {
- // Fetch all contact phone numbers
- p = mResolver.query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null,
- ContactsContract.CommonDataKinds.Phone.CONTACT_ID + " = ?",
- new String[]{contactId},
- null);
- if(p != null) {
- int i = 0;
- phoneNumbers = new String[p.getCount()];
- while (p != null && p.moveToNext()) {
- String number = p.getString(
- p.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
- phoneNumbers[i++] = number;
- }
- p.close();
- }
+ // The phone number we got is the one we will use
+ phoneNumbers = new String[1];
+ phoneNumbers[0] = phone;
+ // Get emails only if we have a contact
+ if(contactId != null) {
// Fetch contact e-mail addresses
p = mResolver.query(ContactsContract.CommonDataKinds.Email.CONTENT_URI, null,
ContactsContract.CommonDataKinds.Phone.CONTACT_ID + " = ?",