Android phone book first matches 10 bits. If it cannot match, it is changed to 7 bits.

Source: Internet
Author: User

Android phone book first matches 10 bits. If it cannot match, it is changed to 7 bits.
Case 1:
If you save A: 04165191666, B: 5191666, the incoming call number is 04165191666.
Because it is A 7-bit match, both A and B can be matched, but the best match is still A, and finally A is displayed;
If the incoming call is 5191666, B is matched.
Case 2:
Save only A: 04165191666,
Call 5191666 or 04165191666 matches.
Case 3:
Save only B: 5191666,
The incoming call 5191666 or 04165191666 matches B.


On the basis of 7 matching, You can further filter matching numbers that meet the conditions.

First, modify MIN_MATCH to a 7-bit match. Modify the following two files to ensure that return MIN_MATCH is all 7
[Bfore KK1]
(1) Modify OldPhoneNumberUtils. cpp (alps \ external \ sqlite \ android), getMinMatch () Return Value
2. MIN_MATCH in PhoneNumberUtils. java (alps \ frameworks \ base \ telephony \ java \ android \ telephony;
[After KK1]
(1) Modify OldPhoneNumberUtils. cpp (alps \ external \ sqlite \ android), getMinMatch () Return Value
(2) Modify PhoneNumberExt. java (mediatek \ frameworks \ base \ op \ java \ com \ mediatek \ op \ telephony)
GetMinMatch () Return Value

Modify DialerSearchUtils. java (alps \ packages \ providers \ contactsprovider \ src \ com \ android \ providers \ contacts)
Public static Cursor findNumberExactMatchedCursor (Cursor cursor, String normalizedNumber) Method
Here we will explain:


This method further filters the exact number based on the number match and returns
Input parameters:
Cursor returns all data after a 7-bit match, from which exact match will be performed in the future.
NormalizedNumber is the number used by call/mms.
Output:
If the response already matches
MatrixCursor exactCursor = matrixCursorFromCursorRow (cursor, cursor. getPosition ());
Cursor. close ();
Return exactCursor;
If no match exists
Return null;

The other two numbers are described as follows:
NormalizedNumber is the number used by call/mms.
Data1 is the complete number found in the database.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.