2

Overview, July 24, 2023

Nokia C01 Plus, Android 11 Go

The original problem raised here was the exception "Sms is not supported" when sending a message, from an app which has the correct settings and has been working for several weeks.

We have diagnosed this as a complete failure of the SMS system on the phone as if it were an Android device without SMS.

The problem is known to be fixed with a cold reboot of the phone, ie Power Off/ Wait / Power On, rather than "Restart".

A second device has registered the same problem.

Doing a cold restart from software is available on some phones, but not this one.

Original Summary

2023-06-24 04:22:41 [STACK_TRACE]=java.lang.UnsupportedOperationException: Sms is not supported

Raised in code which:

  • Has been working on other devices for years,
  • Has been working on this device previously, and on identical models,
  • Was repeated on this device, until it was fixed by a 'Restart',
  • Is not a Permissions problem, and probably not a network failure

The platform history

I have a product which packages an Android app with a consumer phone, and which sends SMS messages from the app to clients (It also receives them). It's been in production for ten years, and the particular lines of code which caused this problem are more than five years old.

In March 2023 we started deploying the app on the Nokia C01 plus phone, with Android 11 Go. Twenty have been deployed, and this problem arose on one of the more recent deployments in June.

We had considerable problems adapting the app to Android 11 Go. New "Permissions" handling were a problem, but handled. An unsolved problem was that the Nokia C01 Plus tries to push OS updates, and this can't be disabled. We attempted to handle this by disabling wi-fi.

The particular phone with this issue was deployed in May 2023. There are identical models both older and more recent which are continuing to function correctly.

The Problem

This particular phone was working as intended (ie. sending SMS over several weeks) when this exception was raised.

2023-06-24 04:22:41
[STACK_TRACE]=java.lang.UnsupportedOperationException: Sms is not supported
    at android.telephony.SmsManager.getISmsServiceOrThrow(SmsManager.java:1658)
    at android.telephony.SmsManager.getSubscriptionId(SmsManager.java:1520)
    at android.telephony.SmsManager.resolveSubscriptionForOperation(SmsManager.java:1545)
    at android.telephony.SmsManager.sendTextMessageInternal(SmsManager.java:601)
    at android.telephony.SmsManager.sendTextMessage(SmsManager.java:443)
    at au.com.cba.nopowersms.services.SendSmsBase.sendSmsToNumber(SendSmsBase.java:192)
    at

From this line in our code...

Line of code 192 which raises exception

After the exception occurred once, it continued to occur each time the app tried to sent an SMS - until the phone was restarted.

The problem IS NOT:

  • Missing permissions. The app has SMS and PHONE permissions, and these also raise a different exception (SecurityException: Sending SMS message: uid 10157 does not have android.permission.SEND_SMS).

  • A “normal” network unavailability problem. I’ve forced network failure by deactivating the SIM with our network provider, and this is handled by the sentIntent

See the handling of results from SmsManager.sendTextMessage in our log below...

App log shows SMS send result being handled

The problem was “fixed” by restarting the phone. No other changes were made (eg. permissions or network access). With a restart, it simply started sending messages correctly again.

However, our network logs show that their may have been network outages at the time of the failure.

Question 1. Could a network outage cause this exception, where deactivating the SIM on the network is properly handled?

My best guess is that rather than being caused by any network issue the phone operating system or hardware has simply failed, and randomly decided that “SMS is not supported”, as if missing the required hardware. This was fixed by restarting the phone. It may be related to the unwanted pushing of updates. However, the same would apply to other phones released

Question 2. Is this likely, ie. for the phone to erroneously report “SMS is not supported”, to be fixed with a restart?

Question 3. Any other explanations or suggestions?

Further info

After initial post...

  • I tested the effect of removing the SIM, trying to reproduce "SMS is not supported". This was handled by the BroadcastReceiver in sentIntent with the result code SmsManager.RESULT_ERROR_NO_SERVICE, and logged.

  • Some googling has produced 'hits' on Dual Sim phones. The Nokia C01 plus is a dual SIM phone!. This may be the problem. I've confirmed that the SIM is correctly inserted in Slot 1, but possibly Nokia/Android have got confused. Maybe the (valid) loss of network service prompted it to switch to SIM 2, which is not there?

  • A second Nokia C01 Plus has failed in the field. From the report by the client the fault is the same. It worked for a month, then stopped sending SMS while otherwise continuing to work. After the first SMS failure it continued to fail. The client hasn't restarted the phone.

  • There was total loss of SMS communications between the first failure (June) and the restart (July). No incoming SMS were received by the App either, and, looking at the Messenger app, by the Android system itself, while the network logs shows them being sent. Definitely an Android and/or hardware problem, probably related to Dual Sim

Stephen Hosking
  • 1,405
  • 16
  • 34
  • 1
    If the issue happens again, before restarting, try calling [SmsManager.getDefault().isSMSCapable()](https://developer.android.com/reference/android/telephony/TelephonyManager#isSmsCapable()) to see if the device thinks it is capable of sending SMS messages. This could help debug the issue. (you might need to use [`context.getSystemService(SmsManager::class.java)` instead of `SmsManager.getDefault()`](https://stackoverflow.com/a/71123909/6309)). – VonC Jul 17 '23 at 06:06
  • 1
    @VonC Any chance that there has been an update to the actual SIM card, wild thought, but just in case ! – djmonki Jul 17 '23 at 16:06
  • @djmonki I've never heard of updates to SIM cards, but I'm exploring everything here. I get my SIMs and network coverage from a network wholesaler (reusing Telstra, Australia, btw), so I can ask them whether they update SIMs. – Stephen Hosking Jul 17 '23 at 23:13
  • @VonC, I'm implementing your first suggesting, while also 1. trying for direct the SmsManager to only use SIM1, and 2. Put a second SIM in slot 2 - not for normal use, but to be there in case the phone (Android or Nokia) try to switch to it. Thanks! – Stephen Hosking Jul 17 '23 at 23:15
  • 1
    @StephenHosking OK. Note, Android has a []`SubscriptionManager` class](https://developer.android.com/reference/android/telephony/SubscriptionManager) that you can use to manage multiple SIM cards. To send an SMS from a specific SIM, you will need to use the Subscription Id of the SIM card. Once you have the Subscription Id, you can use it to get a []`SmsManager`](https://developer.android.com/reference/android/telephony/SmsManager) for that specific SIM card. – VonC Jul 18 '23 at 06:26
  • 1
    @StephenHosking And also note that access to multiple SIM card information requires the [`READ_PHONE_STATE` permission](https://developer.android.com/reference/android/Manifest.permission#READ_PHONE_STATE), so be sure to request this permission if you have not done so already. – VonC Jul 18 '23 at 06:26
  • @djmonki. Re: has the SIM card been updated? I've checked with my network provider (Telstra Australia) and they have confirmed that they don't push updates to SIM cards. They have also confirmed that the two SIMs in the faulty devices have been working through all this period, according to their logs. The say "this looks like an issue with device OS or the SMS application rather than the sim". Good suggestion from you, and we've eliminated one possibility. – Stephen Hosking Jul 22 '23 at 00:10
  • 1
    Is your app configured as the default sms app on the device? If no, can you send an sms using the default messaging app? – derpirscher Jul 23 '23 at 14:47
  • It's not configured as the default sms app on the device, however I have confirmed that no messages were received by the default Android messaging app during the period (several weeks) when the phone lost SMS capability. Confirmed by looking at the network logs, and seeing that messages were sent to it. – Stephen Hosking Jul 24 '23 at 03:48
  • 1
    I had a similar problem with my old Android 10 phone. Had to restart it once in a while because it lost sms connectivity, ie I wasn't able to receive or send texts using the preinstalled default messaging app. So maybe this hasn't to do anything with your app, but it's the device/os that is failing .. But other then restarting I have no idea how to attack this problem, though – derpirscher Jul 24 '23 at 20:58
  • @derpirscher. Thanks! Do you recall whether a 'warm' restart was sufficient, ie. the "Restart" provided as on option on pressing the power button, or whether you had to Power Off / Wait / Power On. It's looking to me that the Nokia has the worst case, ie. requiring a cold restart, which is not available programmatically, where the warm restart is available programmatically (with DeviceOwner privileges, which we have). – Stephen Hosking Jul 28 '23 at 23:20
  • 1
    As far as I recall, a warm restart was sufficient ... – derpirscher Jul 29 '23 at 00:21
  • @derpirscher Thanks so much!!! Since asking this question the issue of warm vs cold restart has become critical, as a warm restart, issued programmatically, is the only solution I have to this problem. I have had one more failure "in the field", and performed a warm restart (with the power button) and it fixed the SMS problem. This, and your response, are very encouraging! – Stephen Hosking Aug 05 '23 at 22:27

0 Answers0