Our investigations suggest that the co-operation of SIM Application Toolkit (STK)  and oFono  does not run smoothly on Sailfish 3 in case of some SIM cards. Our telephony engineers concluded that the following is causing the incorrect and harmful error message "SIM card removed. You need to restart the device..."
We are getting a UICC Reset command from the STK app (running on SIM), that's handled in oFono in such a way that it looks like a SIM removal (and re-insertion) to the rest of the system. The UICC Reset occurs with some SIM cards typically when crossing a borderline between states. Under normal circumstances, most of the SIM cards never send the reset command.
1. How to prevent the issue from happening
Sailfish OS 3.1.0
Sailfish OS version 3.1.0 got a way to disable the STK completely, which should eliminate those incorrect "SIM card removed" messages.
The STK can be turned off in the following way - you will need the developer mode and a text editor (vi) for it:
cp ril_subscription.conf original_ril_subscription.conf ## save it! vi ril_subscription.conf
Add the following line to section [Settings] in the conf file during the 'vi' command above :
Save the file. Restart the device.
Sailfish OS 3.2.0 and later releases
When using this OS version (expected in October 2019), it is no more necessary to manually modify the file
ril_subscription.conf as with OS version 3.1.0.
Under normal circumstances, oFono never enters the internal "SIM reset" state. However, if the problem happens to occur, which would be indicated by the "SIM removed" warning on the phone display, STK gets automatically disabled by the OS until the SIM card in use has been changed or the phone restarted.
2. Drawback of having STK off
SIM-based services cannot run in the phone when the SIM Application Toolkit (STK) is disabled. These services include the use of mobile certificate and some operator-specific functions or value-added services.
Everything else keeps working, and there are no annoying pop-ups and no battery drain anymore.
If your phone and SIM card have not had this issue then the STK will remain enabled in your case.
3. How long will STK stay off? How can it be enabled?
STK will be off till oFono is restarted (Sailfish OS 3.2.0 and later). In practise, STK can be enabled by restarting the whole phone or by issueing the following commands:
systemctl restart ofono
In case of Sailfish OS version 3.1.0 one needs to revert the change made to the configuration file:
cp original_ril_subscription.conf ril_subscription.conf
 SIM Application Toolkit (SIM ATK, STK) is a standard of the GSM system which enables the subscriber identity module (SIM card) to initiate actions which can be used for various value-added services, typically offered by cellular operators. The SIM Toolkit (STK) is a set of commands or applications that define how a SIM card interacts with the outside world. The toolkit is usually programmed into the SIM card. The apps in the SIM can use the user interface of a phone that contains the SIM card.
 oFono is a software entity that provides the applications with APIs to access telephony services (modem abstraction, network registration, voice call handling, short message service, SIM toolkit, and more. Read more at: