diff --git a/core/api/system-current.txt b/core/api/system-current.txt index b4594e00e5c63..c2076f0020f01 100644 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -16190,7 +16190,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; diff --git a/telephony/java/android/telephony/ims/aidl/IImsSmsListener.aidl b/telephony/java/android/telephony/ims/aidl/IImsSmsListener.aidl index 5aa58c1ee7ee5..ae677cad33b8a 100644 --- a/telephony/java/android/telephony/ims/aidl/IImsSmsListener.aidl +++ b/telephony/java/android/telephony/ims/aidl/IImsSmsListener.aidl @@ -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); } diff --git a/telephony/java/android/telephony/ims/stub/ImsSmsImplBase.java b/telephony/java/android/telephony/ims/stub/ImsSmsImplBase.java index 17cb3b46e0f14..e7e0ec212839e 100644 --- a/telephony/java/android/telephony/ims/stub/ImsSmsImplBase.java +++ b/telephony/java/android/telephony/ims/stub/ImsSmsImplBase.java @@ -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