From 85bb4b35f147a4c4a7c047e820d3a4aa5844aa29 Mon Sep 17 00:00:00 2001 From: sqian Date: Wed, 9 Aug 2017 15:28:41 -0700 Subject: [PATCH] Add new error code in SmsManager Design doc: https://docs.google.com/a/google.com/document/d /1YPTNoM2Atjz8oISGAsRYlFVSA1NcYP8MbqYQIzLcJ9E/edit?usp=sharing Test: compile/flash code; test locally Bug: 34773406 Change-Id: I0b227e76048dd46d9c8023d37647db763e1e38e1 Merged-In: I0b227e76048dd46d9c8023d37647db763e1e38e1 --- api/current.txt | 3 +++ api/system-current.txt | 3 +++ api/test-current.txt | 3 +++ telephony/java/android/telephony/SmsManager.java | 6 +++++- 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/api/current.txt b/api/current.txt index 739e7f2509393..343de0e7e3438 100644 --- a/api/current.txt +++ b/api/current.txt @@ -38030,9 +38030,12 @@ package android.telephony { field public static final int MMS_ERROR_UNABLE_CONNECT_MMS = 3; // 0x3 field public static final int MMS_ERROR_UNSPECIFIED = 1; // 0x1 field public static final int RESULT_ERROR_GENERIC_FAILURE = 1; // 0x1 + field public static final int RESULT_ERROR_LIMIT_EXCEEDED = 5; // 0x5 field public static final int RESULT_ERROR_NO_SERVICE = 4; // 0x4 field public static final int RESULT_ERROR_NULL_PDU = 3; // 0x3 field public static final int RESULT_ERROR_RADIO_OFF = 2; // 0x2 + field public static final int RESULT_ERROR_SHORT_CODE_NEVER_ALLOWED = 8; // 0x8 + field public static final int RESULT_ERROR_SHORT_CODE_NOT_ALLOWED = 7; // 0x7 field public static final int STATUS_ON_ICC_FREE = 0; // 0x0 field public static final int STATUS_ON_ICC_READ = 1; // 0x1 field public static final int STATUS_ON_ICC_SENT = 5; // 0x5 diff --git a/api/system-current.txt b/api/system-current.txt index 0aa5d582d027a..582753d1117de 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -41204,9 +41204,12 @@ package android.telephony { field public static final int MMS_ERROR_UNABLE_CONNECT_MMS = 3; // 0x3 field public static final int MMS_ERROR_UNSPECIFIED = 1; // 0x1 field public static final int RESULT_ERROR_GENERIC_FAILURE = 1; // 0x1 + field public static final int RESULT_ERROR_LIMIT_EXCEEDED = 5; // 0x5 field public static final int RESULT_ERROR_NO_SERVICE = 4; // 0x4 field public static final int RESULT_ERROR_NULL_PDU = 3; // 0x3 field public static final int RESULT_ERROR_RADIO_OFF = 2; // 0x2 + field public static final int RESULT_ERROR_SHORT_CODE_NEVER_ALLOWED = 8; // 0x8 + field public static final int RESULT_ERROR_SHORT_CODE_NOT_ALLOWED = 7; // 0x7 field public static final int STATUS_ON_ICC_FREE = 0; // 0x0 field public static final int STATUS_ON_ICC_READ = 1; // 0x1 field public static final int STATUS_ON_ICC_SENT = 5; // 0x5 diff --git a/api/test-current.txt b/api/test-current.txt index 93c9768bc2b64..81b366e2a1409 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -38129,9 +38129,12 @@ package android.telephony { field public static final int MMS_ERROR_UNABLE_CONNECT_MMS = 3; // 0x3 field public static final int MMS_ERROR_UNSPECIFIED = 1; // 0x1 field public static final int RESULT_ERROR_GENERIC_FAILURE = 1; // 0x1 + field public static final int RESULT_ERROR_LIMIT_EXCEEDED = 5; // 0x5 field public static final int RESULT_ERROR_NO_SERVICE = 4; // 0x4 field public static final int RESULT_ERROR_NULL_PDU = 3; // 0x3 field public static final int RESULT_ERROR_RADIO_OFF = 2; // 0x2 + field public static final int RESULT_ERROR_SHORT_CODE_NEVER_ALLOWED = 8; // 0x8 + field public static final int RESULT_ERROR_SHORT_CODE_NOT_ALLOWED = 7; // 0x7 field public static final int STATUS_ON_ICC_FREE = 0; // 0x0 field public static final int STATUS_ON_ICC_READ = 1; // 0x1 field public static final int STATUS_ON_ICC_SENT = 5; // 0x5 diff --git a/telephony/java/android/telephony/SmsManager.java b/telephony/java/android/telephony/SmsManager.java index 07bcb3851d763..f3e6bc4df853e 100644 --- a/telephony/java/android/telephony/SmsManager.java +++ b/telephony/java/android/telephony/SmsManager.java @@ -1128,10 +1128,14 @@ public final class SmsManager { static public final int RESULT_ERROR_NULL_PDU = 3; /** Failed because service is currently unavailable */ static public final int RESULT_ERROR_NO_SERVICE = 4; - /** Failed because we reached the sending queue limit. {@hide} */ + /** Failed because we reached the sending queue limit. */ static public final int RESULT_ERROR_LIMIT_EXCEEDED = 5; /** Failed because FDN is enabled. {@hide} */ static public final int RESULT_ERROR_FDN_CHECK_FAILURE = 6; + /** Failed because user denied the sending of this short code. */ + static public final int RESULT_ERROR_SHORT_CODE_NOT_ALLOWED = 7; + /** Failed because the user has denied this app ever send premium short codes. */ + static public final int RESULT_ERROR_SHORT_CODE_NEVER_ALLOWED = 8; static private final String PHONE_PACKAGE_NAME = "com.android.phone";