In Android, the default number matching digits are 7 digits, that is, from the right to the left, if the two numbers have 7 digits that match, they are considered to be the same number, for example, "+ 86 1234567" and "01234567" are the same numbers. Therefore, "=" cannot be used to determine whether the two numbers match.
Android adds the phone_numbers_equal function in the SQLite layer for number matching judgment. This function is database-level and the corresponding SQL statement is phone_numbers_equal, android registers the function as two parameters and three parameters in the SQLite database. The two parameters are nothing more than number A and number B, the three parameters have an additional bool variable to indicate whether strict matching is used. This strict match is specifically used for Thailand. It seems that Thailand's number rules are special, but in our country, this variable is usually 0.
Go to the topic and modify the number of matching digits for Android. It is actually very simple. Modify oldphonenumberutils. the minimum number of matching digits in the CPP file is the expected number. This number is used in the phone_number_compare_loose function. This function is actually a real number matching function. The file location is: external \ SQLite \ android
Static IntMin_match = 7; // modify it to the number you want
There is also a Java function implementation in the framwork layer, compareloosely (a, B), framewoeks \ base \ telephony \ Java \ Android \ telephony \ phonenumberutils. java, where the min_match used also needs to be modified.
[note]: in the implementation of the phone_number_compare_loose and compareloosely functions on 2.1, a few fewer Code is a bug, it will affect matching of 6-digit numbers in English.