diff options
| author | 2018-02-27 02:48:31 +0000 | |
|---|---|---|
| committer | 2018-02-27 02:48:31 +0000 | |
| commit | c16da498d509a0e529392e03a985efac2cfe20fc (patch) | |
| tree | 16d36c62c678a89ae4b6d8119f10f53e3a89bfd7 | |
| parent | d676c5c13416ec45d1d5f6ca31e558395f8309af (diff) | |
| parent | 1ff8e3412867f63206982f838bb580fec62db5da (diff) | |
Merge "Add more sms error codes"
| -rw-r--r-- | api/system-current.txt | 4 | ||||
| -rw-r--r-- | telephony/java/android/telephony/ims/stub/ImsSmsImplBase.java | 23 |
2 files changed, 21 insertions, 6 deletions
diff --git a/api/system-current.txt b/api/system-current.txt index e3336db34aa8..a289a5802908 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -5250,7 +5250,9 @@ package android.telephony.ims.stub { 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; method public void sendSms(int, int, java.lang.String, java.lang.String, boolean, byte[]); - field public static final int DELIVER_STATUS_ERROR = 2; // 0x2 + field public static final int DELIVER_STATUS_ERROR_GENERIC = 2; // 0x2 + field public static final int DELIVER_STATUS_ERROR_NO_MEMORY = 3; // 0x3 + field public static final int DELIVER_STATUS_ERROR_REQUEST_NOT_SUPPORTED = 4; // 0x4 field public static final int DELIVER_STATUS_OK = 1; // 0x1 field public static final int SEND_STATUS_ERROR = 2; // 0x2 field public static final int SEND_STATUS_ERROR_FALLBACK = 4; // 0x4 diff --git a/telephony/java/android/telephony/ims/stub/ImsSmsImplBase.java b/telephony/java/android/telephony/ims/stub/ImsSmsImplBase.java index bf8953386e49..92d62da8d00c 100644 --- a/telephony/java/android/telephony/ims/stub/ImsSmsImplBase.java +++ b/telephony/java/android/telephony/ims/stub/ImsSmsImplBase.java @@ -74,7 +74,9 @@ public class ImsSmsImplBase { /** @hide */ @IntDef({ DELIVER_STATUS_OK, - DELIVER_STATUS_ERROR + DELIVER_STATUS_ERROR_GENERIC, + DELIVER_STATUS_ERROR_NO_MEMORY, + DELIVER_STATUS_ERROR_REQUEST_NOT_SUPPORTED }) @Retention(RetentionPolicy.SOURCE) public @interface DeliverStatusResult {} @@ -86,7 +88,17 @@ public class ImsSmsImplBase { /** * Message was not delivered. */ - public static final int DELIVER_STATUS_ERROR = 2; + public static final int DELIVER_STATUS_ERROR_GENERIC = 2; + + /** + * Message was not delivered due to lack of memory. + */ + public static final int DELIVER_STATUS_ERROR_NO_MEMORY = 3; + + /** + * Message was not delivered as the request is not supported. + */ + public static final int DELIVER_STATUS_ERROR_REQUEST_NOT_SUPPORTED = 4; /** @hide */ @IntDef({ @@ -106,7 +118,6 @@ public class ImsSmsImplBase { */ public static final int STATUS_REPORT_STATUS_ERROR = 2; - // Lock for feature synchronization private final Object mLock = new Object(); private IImsSmsListener mListener; @@ -157,7 +168,9 @@ public class ImsSmsImplBase { * @param token token provided in {@link #onSmsReceived(int, String, byte[])} * @param result result of delivering the message. Valid values are: * {@link #DELIVER_STATUS_OK}, - * {@link #DELIVER_STATUS_ERROR} + * {@link #DELIVER_STATUS_ERROR_GENERIC}, + * {@link #DELIVER_STATUS_ERROR_NO_MEMORY}, + * {@link #DELIVER_STATUS_ERROR_REQUEST_NOT_SUPPORTED} * @param messageRef the message reference */ public void acknowledgeSms(int token, @DeliverStatusResult int messageRef, int result) { @@ -202,7 +215,7 @@ public class ImsSmsImplBase { mListener.onSmsReceived(token, format, pdu); } catch (RemoteException e) { Log.e(LOG_TAG, "Can not deliver sms: " + e.getMessage()); - acknowledgeSms(token, 0, DELIVER_STATUS_ERROR); + acknowledgeSms(token, 0, DELIVER_STATUS_ERROR_GENERIC); } } } |