Merge "Add api to report the result of sending RP-SMMA to framework"

This commit is contained in:
Megha Patil
2023-01-14 18:57:11 +00:00
committed by Android (Google) Code Review
3 changed files with 35 additions and 1 deletions

View File

@@ -16242,7 +16242,6 @@ 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;

View File

@@ -24,4 +24,5 @@ oneway interface IImsSmsListener {
void onSendSmsResult(int token, int messageRef, int status, int reason, int networkErrorCode);
void onSmsStatusReportReceived(int token, in String format, in byte[] pdu);
void onSmsReceived(int token, in String format, in byte[] pdu);
void onMemoryAvailableResult(int token, int status, int networkErrorCode);
}

View File

@@ -196,6 +196,8 @@ public class ImsSmsImplBase {
*
* @param token unique token generated in {@link ImsSmsDispatcher#onMemoryAvailable(void)} that
* should be used when triggering callbacks for this specific message.
*
* @hide
*/
public void onMemoryAvailable(int token) {
// Base Implementation - Should be overridden
@@ -402,6 +404,38 @@ public class ImsSmsImplBase {
}
}
/**
* This API is used to report the result of sending
* RP-SMMA to framework based on received network responses(RP-ACK,
* RP-ERROR or SIP error).
*
* @param token provided in {@link #onMemoryAvailable()}.
* @param result based on RP-ACK or RP_ERROR
* @param networkErrorCode the error code reported by the carrier
* network if sending this SMS has resulted in an error or
* {@link #RESULT_NO_NETWORK_ERROR} if no network error was generated. See
* 3GPP TS 24.011 Section 7.3.4 for valid error codes and more
* information.
*
* @hide
*/
public final void onMemoryAvailableResult(int token, @SendStatusResult int result,
int networkErrorCode) throws RuntimeException {
IImsSmsListener listener = null;
synchronized (mLock) {
listener = mListener;
}
if (listener == null) {
throw new RuntimeException("Feature not ready.");
}
try {
listener.onMemoryAvailableResult(token, result, networkErrorCode);
} catch (RemoteException e) {
e.rethrowFromSystemServer();
}
}
/**
* This method should be triggered by the IMS providers when the status report of the sent
* message is received. The platform will handle the report and notify the IMS provider of the