James N
James N

Reputation: 511

Android device returns SMS_NOT_SUPPORTED but it is

I've noticed some android devices (Galaxy Fold series not flip) are returning SMS_NOT_SUPPORTED when calling getSMSSupport(), even though the device clearly supports SMS since it has SMS listed in permissions and is able to send SMS. Example code below returns SMS_NOT_SUPPORTED. However, if I comment out case SMS_NOT_SUPPORTED the default messaging app opens as it should etc.

    try {
        switch(Display.getInstance().getSMSSupport()) {
            case Display.SMS_NOT_SUPPORTED:
                errMes = "SMS not supported by this device";
                return false;
            case Display.SMS_SEAMLESS:                    
                Display.getInstance().sendSMS(formatedIntercomTele,intercomMes, false);
                return true;
            case Display.SMS_INTERACTIVE:
                Display.getInstance().sendSMS(formatedIntercomTele,intercomMes, true); 
                return true;
            default:
                Display.getInstance().sendSMS(formatedIntercomTele,intercomMes, true); 
                return true;
        }            
    } catch (IOException ex) {
        errMes = "Unable to send message";
        return false;
    }         

I ran my app using various emulators at different API levels. API 30 for instance will work with a flip phone or standard phone however API 30 will return not supported on any fold phone where the device opens like a book such as the Galaxy Z fold 3.

Upvotes: 2

Views: 55

Answers (1)

Shai Almog
Shai Almog

Reputation: 52770

I think we might need to adapt that code to Galaxy Fold style devices. In order to avoid a permissions prompt this API uses a simple heuristic of checking if this is a tablet or desktop.

This used to work but devices like this are both a phone and a tablet which is something we didn't predict when writing that code. I guess we need to fix the method here. I suggest filing an issue on that.

Upvotes: 1

Related Questions