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

Commit 7c7ede79 authored by Megha Patil's avatar Megha Patil
Browse files

Send Sms Memory Availability notification to ImsService

- Send Memory Availability notification to Ims SMS Service
- Add onMemoryAvailble Api to IImsMmtelFeature.aidl
- Bug: b/240883268

Test: Tested Memory full and Not Full conditions in Pixel6
Change-Id: Iad053fd97e652254e697c3de0b96bb33bb5307d8
parent 9b206fc7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -16029,6 +16029,7 @@ package android.telephony.ims.stub {
    method public void acknowledgeSms(int, @IntRange(from=0, to=65535) int, int, @NonNull byte[]);
    method public void acknowledgeSmsReport(int, @IntRange(from=0, to=65535) int, int);
    method public String getSmsFormat();
    method public void onMemoryAvailable(int);
    method public void onReady();
    method @Deprecated public final void onSendSmsResult(int, @IntRange(from=0, to=65535) int, int, int) throws java.lang.RuntimeException;
    method public final void onSendSmsResultError(int, @IntRange(from=0, to=65535) int, int, int, int) throws java.lang.RuntimeException;
+1 −0
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ interface IImsMmTelFeature {
    void setSmsListener(IImsSmsListener l);
    oneway void sendSms(in int token, int messageRef, String format, String smsc, boolean retry,
            in byte[] pdu);
    oneway void onMemoryAvailable(int token);
    oneway void acknowledgeSms(int token, int messageRef, int result);
    oneway void acknowledgeSmsWithPdu(int token, int messageRef, int result, in byte[] pdu);
    oneway void acknowledgeSmsReport(int token, int messageRef, int result);
+10 −0
Original line number Diff line number Diff line
@@ -268,6 +268,12 @@ public class MmTelFeature extends ImsFeature {
                    .sendSms(token, messageRef, format, smsc, retry, pdu), "sendSms");
        }

        @Override
        public void onMemoryAvailable(int token) {
            executeMethodAsyncNoException(() -> MmTelFeature.this
                    .onMemoryAvailable(token), "onMemoryAvailable");
        }

        @Override
        public void acknowledgeSms(int token, int messageRef, int result) {
            executeMethodAsyncNoException(() -> MmTelFeature.this
@@ -1088,6 +1094,10 @@ public class MmTelFeature extends ImsFeature {
        getSmsImplementation().sendSms(token, messageRef, format, smsc, isRetry, pdu);
    }

    private void onMemoryAvailable(int token) {
        getSmsImplementation().onMemoryAvailable(token);
    }

    private void acknowledgeSms(int token, int messageRef,
            @ImsSmsImplBase.DeliverStatusResult int result) {
        getSmsImplementation().acknowledgeSms(token, messageRef, result);
+14 −0
Original line number Diff line number Diff line
@@ -170,6 +170,20 @@ public class ImsSmsImplBase {
        }
    }

    /**
     * This method will be triggered by the platform when memory becomes available to receive SMS
     * after a memory full event. This method should be implemented by IMS providers to
     * send RP-SMMA notification from SMS Relay Layer to server over IMS as per section 7.3.2 of
     * TS 124.11. Once the RP-SMMA Notification is sent to the network. The network will deliver all
     * the pending messages which failed due to Unavailability of Memory.
     *
     * @param token unique token generated in {@link ImsSmsDispatcher#onMemoryAvailable(void)} that
     *  should be used when triggering callbacks for this specific message.
     */
    public void onMemoryAvailable(int token) {
        // Base Implementation - Should be overridden
    }

    /**
     * This method will be triggered by the platform after
     * {@link #onSmsReceived(int, String, byte[])} has been called to deliver the result to the IMS