[Razer Phone 2 Guides, News, & Discussion] LSS4181:
Recently as I'm currently on a business trip in another city I observed a strange issue.

After a few hours my phone loses SIM card and only by reboot could I restore SIM. Not sure about the exact cause but I suspect IMS might be involved. Toggling Airplane Mode on then off does not help.

The log which appeared right after the phone lost the SIM card:

03-18 15:01:13.643 2606 2606 I TelecomFramework: : onSubscriptionsChanged - update accounts
03-18 15:01:13.643 2606 2606 I TelecomFramework: PstnIncomingCallNotifier: Unregistering: Handler (com.android.internal.telephony.GsmCdmaPhone) {6167860}
03-18 15:01:13.646 2606 2606 I TelecomFramework: TelecomAccountRegistry: setupAccounts: Found 1 phones. Attempting to register.
03-18 15:01:13.647 2606 2606 I TelecomFramework: TelecomAccountRegistry: setupAccounts: Phone with subscription id 1
03-18 15:01:13.647 2606 2606 I TelecomFramework: TelecomAccountRegistry: setupAccounts: adding default
03-18 15:01:13.654 1521 1558 I ActivityManager: Start proc 4719:com.android.dialer/u0a141 for broadcast {com.android.dialer/com.android.dialer.app.voicemail.LegacyVoicemailNotificationReceiver}
03-18 15:01:13.666 1521 3784 W MmsServiceBroker: MmsService not connected. Try connecting...
03-18 15:01:13.666 1521 1521 I MmsServiceBroker: Connecting to MmsService
03-18 15:01:13.667 1521 1521 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.bindService:1649 com.android.server.MmsServiceBroker.tryConnecting:242 com.android.server.MmsServiceBroker.access$000:54 com.android.server.MmsServiceBroker$1.handleMessage:84 android.os.Handler.dispatchMessage:107
03-18 15:01:13.677 1521 1547 I Telecom : PhoneAccountRegistrar: New phone account registered: [[ ] PhoneAccount: ComponentInfo{com.android.phone/com.android.services.telephony.TelephonyConnectionService}, ***, UserHandle{0} Capabilities: CallProvider MultiUser PlaceEmerg SimSub Audio Routes: BESW Schemes: tel voicemail Extras: Bundle[{android.telecom.extra.SUPPORTS_VIDEO_CALLING_FALLBACK=true}] GroupId: ***]: TSI.rPA@AIU
03-18 15:01:13.702 1521 1547 I Telecom : CallsManager: Sending phone-account ComponentInfo{com.android.phone/com.android.services.telephony.TelephonyConnectionService}, ***, UserHandle{0} registered intent as user: TSI.rPA@AIU
03-18 15:01:13.704 1521 1547 I Telecom : CallsManager: Sending phone-account registered intent to default dialer: TSI.rPA@AIU
03-18 15:01:13.705 2606 2606 I TelecomFramework: AccountEntry: Registered phoneAccount: [[ ] PhoneAccount: ComponentInfo{com.android.phone/com.android.services.telephony.TelephonyConnectionService}, ***, UserHandle{0} Capabilities: CallProvider MultiUser PlaceEmerg SimSub Audio Routes: BESW Schemes: tel voicemail Extras: Bundle[{android.telecom.extra.SUPPORTS_VIDEO_CALLING_FALLBACK=true}] GroupId: ***] with handle: ComponentInfo{com.android.phone/com.android.services.telephony.TelephonyConnectionService}, ***, UserHandle{0}
03-18 15:01:13.705 2606 2606 I TelecomFramework: PstnIncomingCallNotifier: Registering: Handler (com.android.internal.telephony.GsmCdmaPhone) {6167860}
03-18 15:01:13.706 2606 2606 I TelecomFramework: TelecomAccountRegistry: Unregistering phone account ComponentInfo{com.android.phone/com.android.services.telephony.TelephonyConnectionService}, ***, UserHandle{0}.
03-18 15:01:13.708 1521 1547 I Telecom : CallsManager: Sending phone-account ComponentInfo{com.android.phone/com.android.services.telephony.TelephonyConnectionService}, ***, UserHandle{0} unregistered intent as user: TSI.uPA@AIc
03-18 15:01:13.708 1521 1547 I Telecom : CallsManager: Sending phone-account unregistered intent to default dialer: TSI.uPA@AIc
03-18 15:01:13.777 1521 27590 I DropBoxManagerService: add tag=system_server_wtf isTagEnabled=true flags=0x2
03-18 15:01:13.797 1521 1521 I MmsServiceBroker: MmsService connected
03-18 15:01:13.822 2606 2606 E AndroidRuntime: FATAL EXCEPTION: main
03-18 15:01:13.822 2606 2606 E AndroidRuntime: Process: com.android.phone, PID: 2606
03-18 15:01:13.822 2606 2606 E AndroidRuntime: java.lang.IllegalStateException: { when=0 what=102 obj=android.os.AsyncResult@65a73cd target=com.android.internal.telephony.PhoneConfigurationManager$MainThreadHandler } This message is already in use.
03-18 15:01:13.822 2606 2606 E AndroidRuntime:	at android.os.MessageQueue.enqueueMessage(MessageQueue.java:553)
03-18 15:01:13.822 2606 2606 E AndroidRuntime:	at android.os.Handler.enqueueMessage(Handler.java:754)
03-18 15:01:13.822 2606 2606 E AndroidRuntime:	at android.os.Handler.sendMessageAtTime(Handler.java:703)
03-18 15:01:13.822 2606 2606 E AndroidRuntime:	at android.os.Handler.sendMessageDelayed(Handler.java:673)
03-18 15:01:13.822 2606 2606 E AndroidRuntime:	at android.os.Handler.sendMessage(Handler.java:611)
03-18 15:01:13.822 2606 2606 E AndroidRuntime:	at android.os.Message.sendToTarget(Message.java:468)
03-18 15:01:13.822 2606 2606 E AndroidRuntime:	at com.android.internal.telephony.RIL.getModemStatus(RIL.java:1005)
03-18 15:01:13.822 2606 2606 E AndroidRuntime:	at com.android.internal.telephony.PhoneConfigurationManager.updatePhoneStatus(PhoneConfigurationManager.java:257)
03-18 15:01:13.822 2606 2606 E AndroidRuntime:	at com.android.internal.telephony.PhoneConfigurationManager.access$200(PhoneConfigurationManager.java:41)
03-18 15:01:13.822 2606 2606 E AndroidRuntime:	at com.android.internal.telephony.PhoneConfigurationManager$MainThreadHandler.handleMessage(PhoneConfigurationManager.java:137)
03-18 15:01:13.822 2606 2606 E AndroidRuntime:	at android.os.Handler.dispatchMessage(Handler.java:107)
03-18 15:01:13.822 2606 2606 E AndroidRuntime:	at android.os.Looper.loop(Looper.java:214)
03-18 15:01:13.822 2606 2606 E AndroidRuntime:	at android.app.ActivityThread.main(ActivityThread.java:7356)
03-18 15:01:13.822 2606 2606 E AndroidRuntime:	at java.lang.reflect.Method.invoke(Native Method)
03-18 15:01:13.822 2606 2606 E AndroidRuntime:	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:491)
03-18 15:01:13.822 2606 2606 E AndroidRuntime:	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:915)
03-18 15:01:13.824 1521 3784 V RescueParty: Disabled because of manual property
03-18 15:01:13.824 1521 4754 I DropBoxManagerService: add tag=system_app_crash isTagEnabled=true flags=0x2
03-18 15:01:13.856 1521 1558 I ActivityManager: Start proc 4759:com.android.vending/u0a160 for broadcast {com.android.vending/com.google.android.finsky.simhandler.SimStateReceiver}
03-18 15:01:13.875 1521 1558 I ActivityManager: Start proc 4770:com.moez.QKSMS/u0a172 for broadcast {com.moez.QKSMS/com.moez.QKSMS.receiver.SmsReceiver}
03-18 15:01:13.883 1521 9314 D ConnectivityService: ConnectivityService NetworkRequestInfo binderDied(NetworkRequest [ LISTEN id=11, [ Transports: WIFI Capabilities: INTERNET&TRUSTED&NOT_VPN Uid: 1001] ], android.os.BinderProxy@1907578)
03-18 15:01:13.883 1521 1521 I MmsServiceBroker: MmsService unexpectedly disconnected
03-18 15:01:13.883 1521 29714 I ActivityManager: Process com.android.phone (pid 2606) has died: pers PER
03-18 15:01:13.884 1521 2220 D ConnectivityService: unregisterNetworkFactory for TelephonyNetworkFactory[0]
03-18 15:01:13.884 1521 2220 D ConnectivityService: unregisterNetworkFactory for PhoneSwitcherNetworkRequstListener
03-18 15:01:13.886 1521 29714 W ActivityManager: Scheduling restart of crashed service com.android.phone/.TelephonyDebugService in 0ms
03-18 15:01:13.886 1521 29714 W ActivityManager: Scheduling restart of crashed service com.android.ons/.OpportunisticNetworkService in 0ms
03-18 15:01:13.886 1521 29714 W ActivityManager: Scheduling restart of crashed service com.android.phone/.vvm.RemoteVvmTaskManager in 0ms
03-18 15:01:13.887 1521 29714 W ActivityManager: Scheduling restart of crashed service com.android.mms.service/.MmsService in 10000ms
03-18 15:01:13.887 1521 29714 W ActivityManager: Re-adding persistent process ProcessRecord{7eb9f3 2606:com.android.phone/1001}
03-18 15:01:13.888 2951 2951 I ActivityThread: Removing dead content provider:android.content.ContentProviderProxy@3300170
03-18 15:01:13.912 1521 1558 I ActivityManager: Start proc 4808:com.android.phone/1001 for restart com.android.phone
03-18 15:01:14.233 1521 29714 W MmsServiceBroker: MmsService not connected. Try connecting...
03-18 15:01:14.236 1521 1521 I MmsServiceBroker: Connecting to MmsService
03-18 15:01:14.236 1521 1521 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.bindService:1649 com.android.server.MmsServiceBroker.tryConnecting:242 com.android.server.MmsServiceBroker.access$000:54 com.android.server.MmsServiceBroker$1.handleMessage:84 android.os.Handler.dispatchMessage:107
03-18 15:01:14.263 4808 4808 E SystemConfig: SystemConfig is being accessed by a process other than system_server.
03-18 15:01:14.266 1521 4878 I DropBoxManagerService: add tag=system_app_wtf isTagEnabled=true flags=0x2
03-18 15:01:14.271 4808 4808 I SystemConfig: Adding association: com.google.android.as <- com.android.providers.contacts
03-18 15:01:14.271 4808 4808 I SystemConfig: Adding association: com.google.android.as <- com.android.providers.media
03-18 15:01:14.271 4808 4808 I SystemConfig: Adding association: com.google.android.as <- com.android.providers.telephony
03-18 15:01:14.271 4808 4808 I SystemConfig: Adding association: com.google.android.as <- com.android.systemui
03-18 15:01:14.271 4808 4808 I SystemConfig: Adding association: com.google.android.as <- com.google.android.gms
03-18 15:01:14.271 4808 4808 I SystemConfig: Adding association: com.google.android.as <- com.google.android.gsf
03-18 15:01:14.306 4808 4808 W SystemConfig: No directory /product/etc/sysconfig, skipping
03-18 15:01:14.311 4808 4808 W SystemConfig: No directory /product_services/etc/sysconfig, skipping
03-18 15:01:14.311 4808 4808 W SystemConfig: No directory /product_services/etc/permissions, skipping
03-18 15:01:14.318 1521 2220 D ConnectivityService: Got NetworkFactory Messenger for PhoneSwitcherNetworkRequstListener
03-18 15:01:14.326 1521 2220 D ConnectivityService: Got NetworkFactory Messenger for TelephonyNetworkFactory[0]
03-18 15:01:14.385 1521 1521 I MmsServiceBroker: MmsService connected

After that the logcat is flooded by things like this for a while:

03-18 15:01:15.059 4808 4808 I TelecomFramework: : onSubscriptionsChanged - update accounts
03-18 15:01:15.059 4808 4808 I TelecomFramework: PstnIncomingCallNotifier: Unregistering: Handler (com.android.internal.telephony.GsmCdmaPhone) {c2dc3bf}
03-18 15:01:15.059 4808 4808 I TelecomFramework: TelecomAccountRegistry: setupAccounts: Found 1 phones. Attempting to register.
03-18 15:01:15.059 4808 4808 I TelecomFramework: TelecomAccountRegistry: setupAccounts: Phone with subscription id -1
03-18 15:01:15.059 4808 4808 I TelecomFramework: TelecomAccountRegistry: setupAccounts: adding default
03-18 15:01:15.064 1521 3760 I Telecom : PhoneAccountRegistrar: Modify account: [ComponentInfo{com.android.phone/com.android.services.telephony.TelephonyConnectionService}, ***, UserHandle{0}]: TSI.rPA@AJE
03-18 15:01:15.065 1521 3760 I Telecom : CallsManager: handlePhoneAccountChanged: phoneAccount=[[X] PhoneAccount: ComponentInfo{com.android.phone/com.android.services.telephony.TelephonyConnectionService}, ***, UserHandle{0} Capabilities: CallProvider MultiUser PlaceEmerg SimSub Audio Routes: BESW Schemes: tel voicemail Extras: Bundle[{android.telecom.extra.SUPPORTS_VIDEO_CALLING_FALLBACK=true}] GroupId: ***]: TSI.rPA@AJE
03-18 15:01:15.066 4808 4808 I TelecomFramework: AccountEntry: Registered phoneAccount: [[ ] PhoneAccount: ComponentInfo{com.android.phone/com.android.services.telephony.TelephonyConnectionService}, ***, UserHandle{0} Capabilities: CallProvider MultiUser PlaceEmerg SimSub Audio Routes: BESW Schemes: tel voicemail Extras: Bundle[{android.telecom.extra.SUPPORTS_VIDEO_CALLING_FALLBACK=true}] GroupId: ***] with handle: ComponentInfo{com.android.phone/com.android.services.telephony.TelephonyConnectionService}, ***, UserHandle{0}
03-18 15:01:15.066 4808 4808 I TelecomFramework: PstnIncomingCallNotifier: Registering: Handler (com.android.internal.telephony.GsmCdmaPhone) {c2dc3bf}
03-18 15:01:15.098 4808 4808 I TelecomFramework: PstnPhoneCapabilitiesNotifier: handleVideoCapabilitesChanged. Video capability - false
03-18 15:01:15.103 1521 3760 I Telecom : PhoneAccountRegistrar: Modify account: [ComponentInfo{com.android.phone/com.android.services.telephony.TelephonyConnectionService}, ***, UserHandle{0}]: TSI.rPA@AJQ
03-18 15:01:15.106 1521 3760 I Telecom : CallsManager: handlePhoneAccountChanged: phoneAccount=[[X] PhoneAccount: ComponentInfo{com.android.phone/com.android.services.telephony.TelephonyConnectionService}, ***, UserHandle{0} Capabilities: CallProvider MultiUser PlaceEmerg SimSub Audio Routes: BESW Schemes: tel voicemail Extras: Bundle[{android.telecom.extra.SUPPORTS_VIDEO_CALLING_FALLBACK=true}] GroupId: ***]: TSI.rPA@AJQ
03-18 15:01:15.286 1521 3760 I WifiService: WifiService trying to set country code to cn
03-18 15:01:15.409 1521 1521 I Telecom : PhoneAccountRegistrar: getSimCallManager: SimCallManager for subId -1 queried, returning: null: TSI.gSCMFU@AJU
03-18 15:01:15.427 4808 4808 I TelecomFramework: : Carrier-config changed, checking for phone account updates.
03-18 15:01:15.507 4808 4808 D MccTable: updateMccMncConfiguration mccmnc='46001
03-18 15:01:15.507 4808 4808 D MccTable: updateMccMncConfiguration: mcc=460, mnc=1
03-18 15:01:15.507 4808 4808 D MccTable: updateMccMncConfiguration updateConfig config={0.0 460mcc1mnc ?localeList ?layoutDir ?swdp ?wdp ?hdp ?density ?lsize ?long ?ldr ?wideColorGamut ?orien ?uimode ?night ?touch ?keyb/?/? ?nav/? winConfig={ mBounds=Rect(0, 0 - 0, 0) mAppBounds=null mWindowingMode=undefined mDisplayWindowingMode=undefined mActivityType=undefined mAlwaysOnTop=undefined mRotation=undefined}}

And later on with these:

03-18 15:01:59.283 1521 1566 E BatteryExternalStatsWorker: no controller energy info supplied for bluetooth
03-18 15:01:59.307 1521 1566 W BatteryExternalStatsWorker: modem info is invalid: ModemActivityInfo{ mTimestamp=0 mSleepTimeMs=0 mIdleTimeMs=0 mTxTimeMs[]=[0, 0, 0, 0, 0] mRxTimeMs=0 mEnergyUsed=0}
03-18 15:01:59.355 1521 1566 E BatteryExternalStatsWorker: no controller energy info supplied for bluetooth
03-18 15:01:59.376 1521 1566 W BatteryExternalStatsWorker: modem info is invalid: ModemActivityInfo{ mTimestamp=0 mSleepTimeMs=0 mIdleTimeMs=0 mTxTimeMs[]=[0, 0, 0, 0, 0] mRxTimeMs=0 mEnergyUsed=0}
03-18 15:01:59.441 1521 1566 E BatteryExternalStatsWorker: no controller energy info supplied for bluetooth
03-18 15:01:59.460 1521 1566 W BatteryExternalStatsWorker: modem info is invalid: ModemActivityInfo{ mTimestamp=0 mSleepTimeMs=0 mIdleTimeMs=0 mTxTimeMs[]=[0, 0, 0, 0, 0] mRxTimeMs=0 mEnergyUsed=0}

And it seems the previous SIM registration attempts would return null:

03-18 15:08:35.604 1521 3784 I Telecom : PhoneAccountRegistrar: getSimCallManager: SimCallManager for subId 1 queried, returning: null: TSI.gSCM@AMo
03-18 15:08:35.727 1521 3784 I Telecom : PhoneAccountRegistrar: getSimCallManager: SimCallManager for subId 1 queried, returning: null: TSI.gSCM@AMs
03-18 15:08:35.764 1521 3784 I Telecom : PhoneAccountRegistrar: getSimCallManager: SimCallManager for subId 1 queried, returning: null: TSI.gSCM@AMw

Additionally, the moment the phone loses SIM card, I would receive a new copy of the very last SMS I ever received... so whenever I receive that SMS I know the phone has lost the SIM card and I need to reboot.

EDIT: Yup. The IMS certainly does have something to do with this. Uninstalled ims.apk and rebooted, and after a few hours I'm able to receive SMS as normal and the SIM card stays working. Just not sure what will happen when I return from the business trip, though.

EDIT 2: I've returned from the business trip and in my home city I could still properly receive SMS without ims.apk installed. Guess ims.apk is really unnecessary for my carrier to receive SMS for now (while my plan does have VoLTE, it never worked correctly on GSI in overall anyway).