From 3aa1d585114f957058c1185c1554f35bcfd9e970 Mon Sep 17 00:00:00 2001 From: Ratchanan Srirattanamet Date: Sun, 2 Nov 2025 02:10:02 +0700 Subject: [PATCH] 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 --- src/qti_ims_sms.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/qti_ims_sms.c b/src/qti_ims_sms.c index 3549c00..8826922 100644 --- a/src/qti_ims_sms.c +++ b/src/qti_ims_sms.c @@ -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) {