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

Commit 92486168 authored by Saifuddin's avatar Saifuddin Committed by Syed Saifuddin Khazi
Browse files

Acknowledge IMS with TPDU with the received Data Coding Scheme, Protocol...

Acknowledge IMS with TPDU with the received Data Coding Scheme, Protocol Identifier and response bytes.

Test: manual(receive class2 SMS)
Change-Id: Id03d41e7b8fb0902c9d725647141b9dd0ebad584
parent 47d87c5a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -15713,6 +15713,7 @@ package android.telephony.ims.stub {
  public class ImsSmsImplBase {
    ctor public ImsSmsImplBase();
    method public void acknowledgeSms(int, @IntRange(from=0, to=65535) int, int);
    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 onReady();
+1 −0
Original line number Diff line number Diff line
@@ -65,6 +65,7 @@ interface IImsMmTelFeature {
    oneway void sendSms(in int token, int messageRef, String format, String smsc, boolean retry,
            in byte[] pdu);
    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);
    String getSmsFormat();
    oneway void onSmsReady();
+11 −0
Original line number Diff line number Diff line
@@ -274,6 +274,12 @@ public class MmTelFeature extends ImsFeature {
                    .acknowledgeSms(token, messageRef, result), "acknowledgeSms");
        }

        @Override
        public void acknowledgeSmsWithPdu(int token, int messageRef, int result, byte[] pdu) {
            executeMethodAsyncNoException(() -> MmTelFeature.this
                    .acknowledgeSms(token, messageRef, result, pdu), "acknowledgeSms");
        }

        @Override
        public void acknowledgeSmsReport(int token, int messageRef, int result) {
            executeMethodAsyncNoException(() -> MmTelFeature.this
@@ -1087,6 +1093,11 @@ public class MmTelFeature extends ImsFeature {
        getSmsImplementation().acknowledgeSms(token, messageRef, result);
    }

    private void acknowledgeSms(int token, int messageRef,
            @ImsSmsImplBase.DeliverStatusResult int result, byte[] pdu) {
        getSmsImplementation().acknowledgeSms(token, messageRef, result, pdu);
    }

    private void acknowledgeSmsReport(int token, int messageRef,
            @ImsSmsImplBase.StatusReportResult int result) {
        getSmsImplementation().acknowledgeSmsReport(token, messageRef, result);
+25 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package android.telephony.ims.stub;

import android.annotation.IntDef;
import android.annotation.IntRange;
import android.annotation.NonNull;
import android.annotation.SystemApi;
import android.os.RemoteException;
import android.telephony.SmsManager;
@@ -174,6 +175,9 @@ public class ImsSmsImplBase {
     * {@link #onSmsReceived(int, String, byte[])} has been called to deliver the result to the IMS
     * provider.
     *
     * If the framework needs to provide the PDU used to acknowledge the SMS,
     * {@link #acknowledgeSms(int, int, int, byte[])} will be called.
     *
     * @param token token provided in {@link #onSmsReceived(int, String, byte[])}
     * @param messageRef the message reference, which may be 1 byte if it is in
     *     {@link SmsMessage#FORMAT_3GPP} format (see TS.123.040) or 2 bytes if it is in
@@ -185,6 +189,27 @@ public class ImsSmsImplBase {
        Log.e(LOG_TAG, "acknowledgeSms() not implemented.");
    }

    /**
     * This method will be called by the platform after
     * {@link #onSmsReceived(int, String, byte[])} has been called to acknowledge an incoming SMS.
     *
     * This method is only called in cases where the framework needs to provide the PDU such as the
     * case where we provide the Short Message Transfer Layer PDU (see 3GPP TS 23.040). Otherwise,
     * {@link #acknowledgeSms(int, int, int)} will be used.
     *
     * @param token token provided in {@link #onSmsReceived(int, String, byte[])}
     * @param messageRef the message reference, which may be 1 byte if it is in
     *     {@link SmsMessage#FORMAT_3GPP} format (see TS.123.040) or 2 bytes if it is in
     *     {@link SmsMessage#FORMAT_3GPP2} format (see 3GPP2 C.S0015-B).
     * @param result result of delivering the message.
     * @param pdu PDU representing the contents of the message.
     */
    public void acknowledgeSms(int token, @IntRange(from = 0, to = 65535)  int messageRef,
            @DeliverStatusResult int result, @NonNull byte[] pdu) {
        Log.e(LOG_TAG, "acknowledgeSms() not implemented. acknowledgeSms(int, int, int) called.");
        acknowledgeSms(token, messageRef, result);
    }

    /**
     * This method will be triggered by the platform after
     * {@link #onSmsStatusReportReceived(int, int, String, byte[])} or