Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2852360d authored by Taesu Lee's avatar Taesu Lee
Browse files

Respond with STATUS_REPORT_STATUS_OK for IMS SMS reports



If a status report format is not same with a sent message, it can not be
handled correctly even if N/W resends same reports again. So a platform
will respond with STATUS_REPORT_STATUS_OK same as CS case always.
STATUS_REPORT_STATUS_ERROR is used only if the platform is not
available.

This scheme is useful when we lose a list for delivery reports due to
restarting the phone process(reboot or crash) as well.

Bug: 174287385
Test: atest ImsSmsDispatcherTest

Signed-off-by: default avatarTaesu Lee <taesu82.lee@samsung.com>
Change-Id: Ic2d1c2570894a3ab7afb1feb03388aa3af75880d
parent 5d0a87bc
Loading
Loading
Loading
Loading
+3 −8
Original line number Diff line number Diff line
@@ -195,17 +195,12 @@ public class ImsSmsDispatcher extends SMSDispatcher {
                    throw new RemoteException(
                            "Status report received with a PDU that could not be parsed.");
                }
                int messageRef = message.mWrappedSmsMessage.mMessageRef;
                boolean handled = mSmsDispatchersController.handleSmsStatusReport(format, pdu);
                if (!handled) {
                    loge("Can not handle the status report for messageRef " + messageRef);
                }
                mSmsDispatchersController.handleSmsStatusReport(format, pdu);
                try {
                    getImsManager().acknowledgeSmsReport(
                            token,
                            messageRef,
                            handled ? ImsSmsImplBase.STATUS_REPORT_STATUS_OK
                                    : ImsSmsImplBase.STATUS_REPORT_STATUS_ERROR);
                            message.mWrappedSmsMessage.mMessageRef,
                            ImsSmsImplBase.STATUS_REPORT_STATUS_OK);
                } catch (ImsException e) {
                    loge("Failed to acknowledgeSmsReport(). Error: " + e.getMessage());
                }
+5 −3
Original line number Diff line number Diff line
@@ -789,9 +789,8 @@ public class SmsDispatchersController extends Handler {
     *
     * @param format the format.
     * @param pdu the pdu of the report.
     * @return true if the report is handled successfully, false Otherwise.
     */
    public boolean handleSmsStatusReport(String format, byte[] pdu) {
    public void handleSmsStatusReport(String format, byte[] pdu) {
        int messageRef;
        SMSDispatcher.SmsTracker tracker;
        boolean handled = false;
@@ -836,7 +835,10 @@ public class SmsDispatchersController extends Handler {
                }
            }
        }
        return handled;

        if (!handled) {
            Rlog.e(TAG, "handleSmsStatusReport: can not handle the status report!");
        }
    }

    private boolean triggerDeliveryIntent(SMSDispatcher.SmsTracker tracker, String format,
+0 −2
Original line number Diff line number Diff line
@@ -180,8 +180,6 @@ public class ImsSmsDispatcherTest extends TelephonyTest {
        pdu[2] = (byte) messageRef;

        when(mPhone.getPhoneType()).thenReturn(PhoneConstants.PHONE_TYPE_GSM);
        when(mSmsDispatchersController.handleSmsStatusReport(eq(SmsMessage.FORMAT_3GPP), eq(pdu)))
                .thenReturn(true);

        // Receive the status report
        mImsSmsDispatcher