[Nexus 4 Q&A, Help & Troubleshooting] santhy:
Hi, it seems that the latest Android 4.3 update being pulled either as OTA has a bug which may render the phone ironically unusable as an actual phone.

Most of you may not be affected, and may factory-reset without any hesitation, and I don't know all of the operators affected, but the following states:

Some carriers are identified by the MNC=00 (it's a number in the SIM card); where most are identified by numbers such that MNC != 0.

4.3 doesn't know about it, and if you wipe data, then the phone app will raise an exception while trying to build the APN list so that your phone can connect to your data provider.

I think the buy is solved with the previous commit, which is already merged to the AOSP trunk in the master branch. However, CyanogenMod and forks haven't yet updated their sources for that particular framework so their builds (and Google's) are keen to fail when a factory reset is done and your SIM operator is identified by 00.

It seems that there are like 14 countries in the world with such an operator.

In Spain, at least the companies Pepephone and Mundo-R may be affected by this bug.

How to deal with it:

1. Do a nandroid backup just in case you want to go back and you don't have a spare time machine.

2. If you must wipe your data partition, be brave and do it.

3. If there are no problems when you reboot and you get carrier signal, then congratulations: your provider isn't affected by this bug.

4. If your phone continuously force-closes, then:

5. Shut the phone down (press Power a while, or press power, dismiss the popup and press Power down)

6. Remove the SIM card

7. Power the phone on

8. Go to Settings > More > Mobile networks > APN

9. Create new APN with your carrier's config.

10. Shut the phone down, put the SIM back on and power on again

11. Messages will appear again, because the rest of the APN list will be filled with buggish stuff

12. While dealing with the messages (yeah, tedious), open Settings > More > Mobile networks > APN

13. WHEN YOU REACH the APN activity, you can enable the Plane Mode so the stupid messages stop coming at every touch to the screen.

You can't enable it before because the Mobile Networks dialog is disabled while on Plane Mode, but there's no problem once you reach APN)

14. For each config that is not the one created by you, click it, press the menu button and Delete APN.

15. You can disable Plane Mode and hopefully it will work.

I tested this on my own (my carrier is Mundo R) and it worked for me.

Found originally in spanish at http://www.tubuntux.com/2013/07/solcionar-bug-android-43-y-pepephone.html

Techie stuff:

The bug is actually triggered by a new function in 4.3 which is in the platform/frameworks/opt/telephony framework at:

./src/java/com/android /internal/telephony/dataconnection/DcTracker.java

The function prototype

private boolean mvnoMatches(IccRecords r, String mvno_type, String mvno_match_data)

And the problem is a String IndexOutOfBoundsException while checking for the GID when the GID is longer in the DB than in the SIM card (SIM has 00).

You can debug this by attaching to the com.android.phone process while in Plane Mode, set breakpoint on every exception and (in my case at least) ignore the first 2~3 (which seem to be correctly "catched") when you exit the Plane Mode.

I hope this helps somebody!

And please, ROM makers, apply the patch (you can be faster than Google to release it!) ;)