[AT&T Samsung Galaxy Note II] barabasy:
Phone and voicemail number not recognized

Hello DN4ers,

I would like start my post by saying that this is the best ROM I have tried on my Note2. The community is very supportive and active as well. Thanks to everyone making this possible. The ROM is stable, fast and feature rich.

With my phone a Canadian version SGH-i317m, the ROM fails to obtain the phone and voicemail numbers from the SIM card for some reason. People in this community nicely suggested workaround to the issue and I can say they worked. Using an exposed framework module allows setting up a number that shows in the About Device screen. Manually setting the voicemail number allows me to listen to my voicemails when holding the 1 key in the phone keypad. I can definitely say that the workaround is good enough for my need. Thanks again to the community for your support.

While trying to understand the issue, I noticed that it is more related to the fact that for some reason DN4 cannot read the necessary data from my ROGERS SIM. Looking at logcat shows exceptions while doing some SIM_IO operation.

Here is what I did so far in my quest to get to the bottom of the issue and hopefully contribute in fixing it:

Make sure that it's not the SIM card the issue by putting it into another android phone (Nexus 4 lollipop, Samsung S3 with stock kk 4.4.2). Both phones automatically found the phone and voicemail numbers and receive voicemail notification.

Make sure that it's not my note2 baseband that has an issue reading the SIM card by flashing another ROMs. I flashed Cyanide, a lollipop CM12.1 based ROM and SaberKat 1.5, a TW based ROM. Both ROMs correctly found the phone and voicemail numbers from the SIM and receive voicemail notification

I looked at build.prop and there is a property rild.libpath that gives the shared library /system/lib/libsec-ril.so used by android to communicate to the radio. I backed the file up and replaced it with the one used by CM12.1 and rebooted. I got a no radio service after that.

I then replaced the library with the one coming from TW based ROM and the radio service was back but no phone number and no voicemail notification. I noticed that the filesize for the library from SK1.5 and DN4 was the same so they are probably the same.

I then used a diff tool to compare files from DN4 and SK1.5 in the hope to spot shared libraries that may make the difference. Of course, a lot of *.so are different but all of the what I could believe ril related libraries are exactly the same. I also looked in the forum for people posting RIL updates and took notes of the name of libraries that they update to check if those libraries differ in DN4 vs SK1.5 but to no available.

I then looked at the TelephonyProvider and DN4 is using SecTelephonyProviderCherry.apk and SK1.5 is using SecTelephonyProvider.apk. I replaced DN4's with SK1.5 telephony provider but that didn't help. It made the Message app force close due to different database version. The logcat also mentioned something about not finding my carrier in its database. In fact, in DN4, I add to manually add the correct apn for my carrier to get LTE. There was two apns for my carrier by default but they were old.

I then copied the /system/csc content for my carried from SK1.5 to DN4 and at least that brought the correct APN for my provider but still no phone and voicemail notification.

I installed AIDE to be able to write some code that interacts with the TelephonyManager but when I requested the phone number it returned empty with no exception from the radio

At this point I am running out of ideas. I am installing android studio on my machine to be able to build https://github.com/scintill/AndroidSIMFileReader and run it on my note2. My intent is to be able to generate exception from the ril if the issue is library related by reading the SIM filesystem.