fakemanoan / LineageOS-Releases

LineageOS releases for devices.
57 stars 2 forks source link

Unable to reliably connect to mobile network when SIM pin is present #79

Open BlueSapphire93 opened 4 months ago

BlueSapphire93 commented 4 months ago

Build used

20240313-UNOFFICIAL-zerofltexx

Model number

G920F

Describe the bug

After booting up phone, the sim pin prompt would appear, but then quickly disappear again. A popup would then appear saying "Sim card removed. The mobile network will be unavailable until you restart with a valid SIM card inserted". It was sometimes possible to connect to the mobile network, if I very quickly unlocked the phone and entered the SIM pin as soon as the phone booted. Once I was successful doing this, I removed the SIM card pin, rebooted the phone several times, but was unable to reproduce the problem anymore.

To Reproduce

1) Have lock SIM card enabled under Security -> More Security settings -> Sim card lock
2) Restart phone, and wait ~15 seconds after the phone fully boots. The SIM card pin prompt would initially appear, but then disappear again before the 15 seconds elapsed. 3) Unlock phone and the following message appears "Sim card removed. The mobile network will be unavailable until you restart with a valid SIM card inserted". 4) I repeated steps 2&3 7 more times and saw the same behavior each time. 5) Reboot phone and as quickly as possible, unlock & enter the Sim pin. I had some success connecting to the mobile network when doing this, although sometimes it took more than 1 attempt. 6) Once successful on step 5, go to Security -> More Security settings -> Sim card lock and remove the SIM card lock 7) I restarted the phone, waited 20 seconds after it rebooted and had no issues connecting to the mobile network. 8) I repeated step 7 6 more times, each time I had no issue connecting to the network.
9) Enabled SIM card lock again under Security -> More Security settings -> Sim card lock 10) Rebooted phone and waited 15 seconds. Again unable to connect to the mobile network.

Any extra info

No response

fakemanoan commented 4 months ago

Thanks for making a bug report.

Can you capture some radio logs for me? At your PC, type "adb logcat -b radio > radio.txt". If you need help doing this, follow this guide: https://wiki.lineageos.org/how-to/logcat/. Press CTRL+C after the issue occurs to finish writing the logs and upload the file created so I can access it. This will help me narrow down the issue.

Did you update via OTA/dirty flashing? If so, I would appreciate it if you could test doing a completely clean flash with the latest version and updating how that works for you here.

Here is a link to the build affected: https://github.com/fakemanoan/LineageOS-Releases/releases/download/A13-13032024/lineage-20.0-20240313-UNOFFICIAL-zerofltexx.zip

The last update involved swapping to a newer Samsung radio stack which fixes some calling issues and build hacks we had to use, and in my testing worked flawlessly, so I suspect it is related to some process related to updating rather than clean installing

BlueSapphire93 commented 4 months ago

I updated via dirty flashing. I will try and get around to performing a clean flash later today. Attached are the radio logs, one with the problem and one without the problem. For the latter, I kept the SIM pin enabled, but unlocked the phone and entered the SIM pin really fast after reboot. Mobile_Connection_NOK_radio.txt Mobile_connection_OK_radio.txt

BlueSapphire93 commented 4 months ago

Your suspicions are correct it seems. I am unable to reproduce the problem after a clean flash.

fakemanoan commented 4 months ago

Interesting. There might be some file/db incompatibilities with the OSS RIL vs Samsungs RIL, which causes it to error out when doing pin unlocks.

If it is a file (or something akin to that), I will just have the system delete the OSS version of the file on each boot if thats possible

If it isn't possible to simply delete, the solution for the time being is to mandate clean flashes, which wouldn't be ideal, but is at least a solution.

WIP for now.

fakemanoan commented 4 months ago

Interesting update: clean builds and installs of 19.1 exhibit the issue every time for me now, but only on an S6 and only 19.1. Note 5 seems to be completely fine. Lineage 20.0 clean builds/installs are fine.

Adding to the mystique, lineage 18.1 also does not have this issue. Quite strange.

Seems like RIL is reporting the sim being absent after failing to send a particular command, while the note 5 cleanly resets, gonna need to do some more digging. Might be some note 5 specific change I made in 19.1 causing a bit of issues there

I could revert back to the OSS radio, but that would suck for numerous reasons. I think having people remove the sim lock prior to installing/updating is the only viable solution given the weird nature of this issue. Definitely need some more time to look into this.

fakemanoan commented 3 months ago

Either I am missing something from the logs or it is a different issue that affects more stuff.

I was able to recreate the issue on a LOS 20 install even after clean flashing just by doing an update. I did some comparisons and nothing really stood out. The Note 5 I recently acquired does not have any of these problems.

But I remember some users were having trouble detecting a SIM at all in some previous versions of the ROM last year. After reverting a few commits from that period, it appears I have fixed the problem?

Still need to narrow down what precisely happened, but I suspect something else is at play. I would love to get a fresh S6 and see if this is the case, but unfortunately that is not possible for me atm.

Just out of curiosity, have you ever installed Floyd ROM? Have you ever installed the "trebleizer" script either?

Hirn-100 commented 3 months ago

I got this error when installing lineage-20.0-20240313- UNOFFICIAL-zeroltexx for samsung s6 edge. Immediately after installation, I was able to enter the PIN of the SIM card, but after restarting, the PIN input window disappeared very quickly. I followed the advice to unlock the SIM card and inserted it into the samsung s6 (lineage is installed-20.0-20240313- UNOFFICIAL-zerofltexx). It was possible to unlock the SIM card, but samsung s6 edge did not see the SIM card carrier. And after I inserted my native SIM card into the samsung s6, an error with entering the PIN code appeared on it.

I had to install lineage-19.1-20240220 on both devices. And so far everything is working fine.

BlueSapphire93 commented 3 months ago

Either I am missing something from the logs or it is a different issue that affects more stuff.

I was able to recreate the issue on a LOS 20 install even after clean flashing just by doing an update. I did some comparisons and nothing really stood out. The Note 5 I recently acquired does not have any of these problems.

But I remember some users were having trouble detecting a SIM at all in some previous versions of the ROM last year. After reverting a few commits from that period, it appears I have fixed the problem?

Still need to narrow down what precisely happened, but I suspect something else is at play. I would love to get a fresh S6 and see if this is the case, but unfortunately that is not possible for me atm.

Just out of curiosity, have you ever installed Floyd ROM? Have you ever installed the "trebleizer" script either?

No, I never installed any of those. Let me know if there is anything specific that you would like to test out.

atithi02 commented 3 months ago

I'm using version 19.1 from March on my SM-G920F phone and had no problem entering the PIN until the phone suddenly restarted while trying to end a call. After restarting, I couldn't do it anymore. It happened to me a month ago and this week for the second time. I think in both cases I had the network set to 4G. I fixed it by doing: