qti_ims_sms: honor request to retry and fallback from Binder service

Sometimes the QTI IMS service indicates that it wants a fallback. If we
use `BINDER_EXT_SMS_SEND_RESULT_ERROR` as an error code, then the
required fallback won't happen. Switch to `_SEND_RESULT_RETRY` instead
which will trigger a GSM fallback inside ofono-binder-plugin.

While we're at it, do the same with retry request as well. I suspect
it actually meant to retry with IMS again, but I guess going straight
to GSM directly won't hurt?

Fixes: https://forums.ubports.com/post/89917
Fixes: https://t.me/ubports_devel/97049
This commit is contained in:
Ratchanan Srirattanamet
2025-11-02 02:10:02 +07:00
parent 1ca8078199
commit 3aa1d58511

View File

@@ -300,10 +300,26 @@ qti_ims_sms_result_request_response(
DBG("qti_ims_sms_result_request_response\n");
DBG("result: %d\n", result);
if (result == QTI_RADIO_SEND_STATUS_OK) {
switch (result) {
case QTI_RADIO_SEND_STATUS_OK:
send_result = BINDER_EXT_SMS_SEND_RESULT_OK;
} else {
break;
case QTI_RADIO_SEND_STATUS_ERROR:
send_result = BINDER_EXT_SMS_SEND_RESULT_ERROR;
break;
case QTI_RADIO_SEND_STATUS_ERROR_RETRY:
send_result = BINDER_EXT_SMS_SEND_RESULT_RETRY;
break;
case QTI_RADIO_SEND_STATUS_ERROR_FALLBACK:
/* There's no equivalent code in ofono-binder-plugin, but using
* BINDER_EXT_SMS_SEND_RESULT_RETRY does get it to fallback to GSM. */
send_result = BINDER_EXT_SMS_SEND_RESULT_RETRY;
break;
default:
ofono_warn("Unknown error code from binder %d, "
"falling back to GSM.", result);
send_result = BINDER_EXT_SMS_SEND_RESULT_RETRY;
break;
}
if (req->complete) {