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

Commit 304f4b55 authored by Mohamed Abdalkader's avatar Mohamed Abdalkader Committed by Brad Ebinger
Browse files

Add and trigger onReady API for SMS over IMS.

Test: manual test that normal code path is fine since this code path is
not yet exercisable.
BUG=69846044
Merged-In: Icb15ca4aa6606fba641f6270dca5e0e06fc4466a
Change-Id: Icb15ca4aa6606fba641f6270dca5e0e06fc4466a
parent 904c1eca
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -4312,6 +4312,7 @@ package android.telephony.ims.internal.stub {
    method public void acknowledgeSms(int, int, int);
    method public void acknowledgeSmsReport(int, int, int);
    method public java.lang.String getSmsFormat();
    method public void onReady();
    method public final void onSendSmsResult(int, int, int, int) throws java.lang.RuntimeException;
    method public final void onSmsReceived(int, java.lang.String, byte[]) throws java.lang.RuntimeException;
    method public final void onSmsStatusReportReceived(int, int, java.lang.String, byte[]) throws java.lang.RuntimeException;
+11 −0
Original line number Diff line number Diff line
@@ -209,6 +209,13 @@ public class MMTelFeature extends ImsFeature {
                return MMTelFeature.this.getSmsFormat();
            }
        }

        @Override
        public void onSmsReady() {
            synchronized (mLock) {
                MMTelFeature.this.onSmsReady();
            }
        }
    };

    /**
@@ -403,6 +410,10 @@ public class MMTelFeature extends ImsFeature {
        getSmsImplementation().acknowledgeSmsReport(token, messageRef, result);
    }

    private void onSmsReady() {
        getSmsImplementation().onReady();
    }

    /**
     * Must be overridden by IMS Provider to be able to support SMS over IMS. Otherwise a default
     * non-functional implementation is returned.
+13 −0
Original line number Diff line number Diff line
@@ -185,6 +185,8 @@ public class SmsImplBase {
     * platform will deliver the message to the messages database and notify the IMS provider of the
     * result by calling {@link #acknowledgeSms(int, int, int)}.
     *
     * This method must not be called before {@link #onReady()} is called.
     *
     * @param token unique token generated by IMS providers that the platform will use to trigger
     *              callbacks for this message.
     * @param format the format of the message. Valid values are {@link SmsMessage#FORMAT_3GPP} and
@@ -210,6 +212,8 @@ public class SmsImplBase {
     * This method should be triggered by the IMS providers to pass the result of the sent message
     * to the platform.
     *
     * This method must not be called before {@link #onReady()} is called.
     *
     * @param token token provided in {@link #sendSms(int, int, String, String, boolean, byte[])}
     * @param messageRef the message reference. Should be between 0 and 255 per TS.123.040
     * @param status result of sending the SMS. Valid values are:
@@ -297,4 +301,13 @@ public class SmsImplBase {
    public String getSmsFormat() {
      return SmsMessage.FORMAT_3GPP;
    }

    /**
     * Called when SmsImpl has been initialized and communication with the framework is set up.
     * Any attempt by this class to access the framework before this method is called will return
     * with an {@link RuntimeException}.
     */
    public void onReady() {
        // Base Implementation - Should be overridden
    }
}
+1 −0
Original line number Diff line number Diff line
@@ -61,4 +61,5 @@ interface IImsMMTelFeature {
    oneway void acknowledgeSms(int token, int messageRef, int result);
    oneway void acknowledgeSmsReport(int token, int messageRef, int result);
    String getSmsFormat();
    oneway void onSmsReady();
}