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

This commit is contained in:
Syed Saifuddin Khazi
2022-12-02 03:22:42 +00:00
committed by Android (Google) Code Review
4 changed files with 38 additions and 0 deletions

View File

@@ -15912,6 +15912,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();

View File

@@ -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();

View File

@@ -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);

View File

@@ -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