1. After saving the number "12345678" as the contact test
2. Enter the text message editing interface, enter "13712345678" in the Recipient field, and then switch to the text input box, so that the recipient control loses focus, you can see the recipient immediately displayed as "Test", and then go back to click on the recipient, found that the target number becomes "12345678".
3. Send a message indicating that the send failed.
PS: The user originally wanted to send the text message to "13712345678", the result because the phone book stored a "12345678" contact person, the system will send the target number to change, resulting in the failure of information delivery.
Number matching related problems can be verified in the following way, if there are exceptions, please submit eservice to MediaTek.
Alps\frameworks\ex\chips\src\com\android\ex\chips\ Replace Getrecipiententrybyphonenumber () in Recipientalternatesadapter.java with the following code:
public static Recipiententry Getrecipiententrybyphonenumber (context context, String PhoneNumber) {
LOG.D (TAG, "[Getrecipiententrybyphonenumber] PhoneNumber:" + phonenumber); M:MTK Debug Log
if (PhoneNumber = = NULL | | Textutils.isempty (PhoneNumber)) {
return null;
}
Final string[] phone_lookup_projection = new string[] {
phone._id,//0
PHONE.CONTACT_ID,//1
Phone.number,//2
Phone.normalized_number,//3
Phone.display_name,//4
};
Long index =-1;
String currentnumber = "";
String Normalizednumber = Phonenumberutils.normalizenumber (PhoneNumber);
M:query contact_id by giving phone number
Cursor cursornormalize = Context.getcontentresolver (). Query (
Uri.withappendedpath (Phonelookup.content_filter_uri, Normalizednumber), phone_lookup_projection, NULL, NULL, NULL);
M:return NULL if query result is empty
if (cursornormalize = = null) {
LOG.D (TAG, "[Getrecipiententrybyphonenumber] cursornormalize is null"); M:MTK Debug Log
return null;
}
if (Cursornormalize.movetofirst ()) {
do {
index = Cursornormalize.getlong (1); m:phone.contact_id
if (log.isloggable (TAG, log.debug)) {
LOG.D (TAG, "[Getrecipiententrybyphonenumber] Query ID for" + PhoneNumber
+ "RESULTS:"
+ "NAME:" + cursornormalize.getstring (4)
+ "Contact ID:" + cursornormalize.getlong (1)
+ "ADDRESS:" + cursornormalize.getstring (2));
}
} while (Cursornormalize.movetonext ());
}
Cursornormalize.close ();
M:no matched Contact
if (index = =-1) {
return null;
}
M:query contact information by giving contact_id
Recipiententry entry = null;
for (long i = index; i > 0; i--) {
LOG.D (TAG, "getrecipiententrybyphonenumber i =" + i);
cursor cursor = context.getcontentresolver (). Query (
Queries.PHONE.getContentUri (),
Queries.PHONE.getProjection (),
Queries.PHONE.getProjection () [Queries.Query.CONTACT_ID] + "in (" + string.valueof (i) + ")", null, NULL);
if (Cursor.movetofirst ()) {
do {
if (cursor.getstring (Queries.Query.DESTINATION). Length () < Currentnumber.length ())
Break
if (true) {
LOG.D (TAG, "[Getrecipiententrybyphonenumber] Query detail for" + PhoneNumber
+ "RESULTS:"
+ "NAME:" + cursor.getstring (Queries.Query.NAME)
+ "Contact ID:" + cursor.getlong (Queries.Query.CONTACT_ID)
+ "ADDRESS:" + cursor.getstring (Queries.Query.DESTINATION));
}
Currentnumber = cursor.getstring (1); M:phone.number
if (Phonenumberutils.compare (Phonenumberutils.normalizenumber (Currentnumber), Normalizednumber)) {
Entry = Recipiententry.constructtoplevelentry (
Cursor.getstring (Queries.Query.NAME),
Cursor.getint (Queries.Query.DISPLAY_NAME_SOURCE),
Cursor.getstring (Queries.Query.DESTINATION),
Cursor.getint (Queries.Query.DESTINATION_TYPE),
Cursor.getstring (Queries.Query.DESTINATION_LABEL),
Cursor.getlong (Queries.Query.CONTACT_ID),
Cursor.getlong (Queries.Query.DATA_ID),
Cursor.getstring (Queries.Query.PHOTO_THUMBNAIL_URI),
True, false);
Break
}
} while (Cursor.movetonext ());
}
LOG.D (TAG, "[Getrecipiententrybyphonenumber] Cursor Count:" + (cursor! = null?) Cursor.getcount (): "null")); M:MTK Debug Log
Cursor.close ();
}
if (Phonenumber.length ()-entry.getdestination (). Length ()! = 3 | | entry.getdestination (). Length () < 11) {
LOG.D (TAG, "the query does not meet the conditon, drop it");
Entry = NULL;
}
return entry;
}
Precautions:
1. First mm build Frameworks/ex/chips
2. Then mm build Packages/app/mms
Send the generated MMS push to the phone
Android SMS Recipient Auto Match is inconsistent with user input display