Since IMS doesn’t appear as an actual app on the phone, it won’t appear in Duraspeed or Battery Optimizer settings. Duraspeed is a built-in Mediatek (the phone processor) app which kills apps in the background when the phone is experiencing slow-downs. Battery Optimizer is a remant of the original Android operating system that kills apps in the background to prevent them from using battery power. From the experiences above, I guess it’s possible that the custom ROM is allowing IMS (which is required to receive messages) to be stopped in the background. Looking through logs from my phone, I found no evidence that IMS had been stopped in the background, but it’s possible.
This first command can possibly force IMS into the whitelist of Duraspeed. You can access Duraspeed settings on the phone, but IMS doesn’t appear in the list of apps, so this command just overrides the list and allows you to whitelist it along with your other allowed apps.
Similarly, IMS doesn’t appear in the list of apps you can allow in the Battery Optimizer settings. This command possibly will force the Battery Optimizer to allow IMS.
I continue to say possibly only because I have zero evidence from my phone logs that IMS was being force closed. I ran these commands on my phone anyway, just to be safe. I can’t prove they worked because I have no evidence to the contrary. However, I see no reason of danger, since IMS is something you want your phone to allow in the background anyway.