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.