[Moto G Q&A, Help & Troubleshooting] negrostmthws:
Hello everyone! :)

First of all, thank you for the work put in this site. Been using it for months and you're just great.

Phone info:

I'm from Argentina, under PERSONAL carrier.

Device Moto G 2013 XT1032, Lollipop 5.1.1, Kernel 3.4.109-AOSP (alberto97's) Unlocked Bootloader, Rooted, Using TWRP 3.0.2-0, Xposed v.86, SuperSU v2.76.

One week ago I flashed "XT1032_Retail_US_51_Optimized_v1.0 5.1" over my Personal Argentina Retail stock 5.1 rom (it came with the phone), installed "AOSP-5.1.1-20150923-falcon-alberto97", Gapps Pico, and so on.

Now my incoming calls are not being recognized as contacts. Here in Buenos Aires, Argentina, the complete "international" number with area code and prefix (for mobile phones) is +54 9 11 X XXX XXXX. "54" Country, "9" Mobile, "11" Buenos Aires". Whatsapp gets and show numbers in that International format. Incoming calls and SMS arrive without the "9" for example "+54 11 X XXX XXXX" and my phone always recognized the contact. (It even recognized incoming calls and SMS If the number was stored like 11 X XXX XXXX, 0 11 15 X XXX XXXX, 11 15 X XXX XXXX (15 is mobile phone locally, but from mobile to mobile it's not required) and with one or two different formats.

The point is, after flashing 5.1 Retail US and 5.1.1 AOSP, the contacts are not recognized if they have the "9", (the way it shows on Incoming Calls and SMS) (but then, If i edit the contact number, Whatsapp doesn't recognize it for lacking that "9"). I refuse to have two different numbers for each contact, with and without the "9".

What I would like is the phone to recognize incoming calls WITHOUT the "9", when the contact is stored WITH that "9" between Area Code and the rest of the numbers. Or change the incoming calls format so it "reads" or "adds" the "9" between +54 and 11.

- I searched and searched for info and solutions but wasn't able to fix it.

- I deleted all my contacts, changed in default country code on Google Contacts, went back to Argentina and re-synced with phone, no luck.

- I tried editing ro.phone.min_match on build.prop to 7,8,9,10,11, (with and without deleting from phone and re-syncing contacts from google) no luck.

- I tried with Prefix app on Google Play, no luck.

-I tried understanding classes and searched Android Developers pages to see if I could get it working but my knowledge doesn't go that far (at least regarding Android).

- I opened "PhoneNumberUtils.smali" but didn't find this code to edit:

.local v7, minMatchLen:I
const/4 v7, 0xb

.local v0, minMatchLen:I
const/4 v0, 0xb

Some said to change that "b" value to "7" or another number, depending on my country number format. Nevertheless, isn't this the same as establishing a min match on build.prop?

So, I'm running out of imagination. I always try to find the answer/fix to avoid posting about issues but this is getting a bit hard.

TO-DO: I downloaded a 5.1 retail Argentina Personal stock rom. I will try to look for the "PhoneNumberUtils.smali" file and use it to replace the one on my phone to see if it works.

EDIT1:

I managed to get "PhoneNumberUtils.smali" from stock Personal Argentina retail 5.1 rom but the code I'm looking for isn't there neither.

EDIT2:

Found ".field static final MIN_MATCH:I = 0x7" at the beginning, was set to 0x7.

Found this code:

.method public static toCallerIDMinMatch(Ljava/lang/String;)Ljava/lang/String;
.registers 5 [B](Note by me: What's this number?)[/B]
.param p0, "phoneNumber" # Ljava/lang/String;

.prologue
.line 788
invoke-static {p0}, Landroid/telephony/PhoneNumberUtils;->extractNetworkPortionAlt(Ljava/lang/String;)Ljava/lang/String;

move-result-object v2

.line 792
.local v2, "np":Ljava/lang/String;
const-string v3, "gsm.sim.min.match"

invoke-static {v3}, Landroid/os/SystemProperties;->get(Ljava/lang/String;)Ljava/lang/String;

move-result-object v1

.line 793
.local v1, "minMatchProp":Ljava/lang/String;
invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

move-result v3

if-nez v3, :cond_19

.line 794
invoke-static {v1}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

move-result v0

.line 799
.local v0, "minMatch":I
:goto_14
invoke-static {v2, v0}, Landroid/telephony/PhoneNumberUtils;->internalGetStrippedReversed(Ljava/lang/String;I)Ljava/lang/String;

move-result-object v3

return-object v3
[B]
.line 796
.end local v0 # "minMatch":I
:cond_19
const/4 v0, 0x7[/B]

.restart local v0 # "minMatch":I
goto :goto_14
.end method

Apparently it's set to 0x7, so it should compare the last 7 digits, so theoretically it should be detecting the numbers as contacts, but it doesn't :/ .

Sorry for the long post. I tried to be as specific as possible but incorporating everything that I thought it would help.

Thanks again!!!