summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Tom Taylor <tomtaylor@google.com> 2021-06-17 10:15:00 -0700
committer Sarah Chin <sarahchin@google.com> 2022-05-12 11:05:06 -0700
commit88b5149d4e3e2201f5a22bc17e6c5b00b6131663 (patch)
tree8f6b0cfc982a2d3a477f0149fc4f83fd3ba88a49
parent25157d1128a8da645c32a1a50af8498137e9b350 (diff)
Add new MMS result codes
Test: manual - sent/received mms Bug: 185275986 Change-Id: I190345240482437289d26101857d805cf06e0341 Merged-In: I190345240482437289d26101857d805cf06e0341
-rw-r--r--core/api/current.txt3
-rw-r--r--telephony/java/android/telephony/SmsManager.java99
2 files changed, 102 insertions, 0 deletions
diff --git a/core/api/current.txt b/core/api/current.txt
index e4fc9f3a57d1..5944991d347c 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -41215,8 +41215,11 @@ package android.telephony {
field public static final String MMS_CONFIG_UA_PROF_URL = "uaProfUrl";
field public static final String MMS_CONFIG_USER_AGENT = "userAgent";
field public static final int MMS_ERROR_CONFIGURATION_ERROR = 7; // 0x7
+ field public static final int MMS_ERROR_DATA_DISABLED = 11; // 0xb
field public static final int MMS_ERROR_HTTP_FAILURE = 4; // 0x4
+ field public static final int MMS_ERROR_INACTIVE_SUBSCRIPTION = 10; // 0xa
field public static final int MMS_ERROR_INVALID_APN = 2; // 0x2
+ field public static final int MMS_ERROR_INVALID_SUBSCRIPTION_ID = 9; // 0x9
field public static final int MMS_ERROR_IO_ERROR = 5; // 0x5
field public static final int MMS_ERROR_NO_DATA_NETWORK = 8; // 0x8
field public static final int MMS_ERROR_RETRY = 6; // 0x6
diff --git a/telephony/java/android/telephony/SmsManager.java b/telephony/java/android/telephony/SmsManager.java
index 5171cf9dcea7..e8e22b6fb08d 100644
--- a/telephony/java/android/telephony/SmsManager.java
+++ b/telephony/java/android/telephony/SmsManager.java
@@ -2633,6 +2633,19 @@ public final class SmsManager {
* sending the message.
* @param sentIntent if not NULL this <code>PendingIntent</code> is
* broadcast when the message is successfully sent, or failed
+ * The result code will be <code>Activity.RESULT_OK</code> for success
+ * or one of these errors:<br>
+ * <code>MMS_ERROR_UNSPECIFIED</code><br>
+ * <code>MMS_ERROR_INVALID_APN</code><br>
+ * <code>MMS_ERROR_UNABLE_CONNECT_MMS</code><br>
+ * <code>MMS_ERROR_HTTP_FAILURE</code><br>
+ * <code>MMS_ERROR_IO_ERROR</code><br>
+ * <code>MMS_ERROR_RETRY</code><br>
+ * <code>MMS_ERROR_CONFIGURATION_ERROR</code><br>
+ * <code>MMS_ERROR_NO_DATA_NETWORK</code><br>
+ * <code>MMS_ERROR_INVALID_SUBSCRIPTION_ID</code><br>
+ * <code>MMS_ERROR_INACTIVE_SUBSCRIPTION</code><br>
+ * <code>MMS_ERROR_DATA_DISABLED</code><br>
* @throws IllegalArgumentException if contentUri is empty
*/
public void sendMultimediaMessage(Context context, Uri contentUri, String locationUrl,
@@ -2661,6 +2674,19 @@ public final class SmsManager {
* sending the message.
* @param sentIntent if not NULL this <code>PendingIntent</code> is
* broadcast when the message is successfully sent, or failed
+ * The result code will be <code>Activity.RESULT_OK</code> for success
+ * or one of these errors:<br>
+ * <code>MMS_ERROR_UNSPECIFIED</code><br>
+ * <code>MMS_ERROR_INVALID_APN</code><br>
+ * <code>MMS_ERROR_UNABLE_CONNECT_MMS</code><br>
+ * <code>MMS_ERROR_HTTP_FAILURE</code><br>
+ * <code>MMS_ERROR_IO_ERROR</code><br>
+ * <code>MMS_ERROR_RETRY</code><br>
+ * <code>MMS_ERROR_CONFIGURATION_ERROR</code><br>
+ * <code>MMS_ERROR_NO_DATA_NETWORK</code><br>
+ * <code>MMS_ERROR_INVALID_SUBSCRIPTION_ID</code><br>
+ * <code>MMS_ERROR_INACTIVE_SUBSCRIPTION</code><br>
+ * <code>MMS_ERROR_DATA_DISABLED</code><br>
* @param messageId an id that uniquely identifies the message requested to be sent.
* Used for logging and diagnostics purposes. The id may be 0.
* @throws IllegalArgumentException if contentUri is empty
@@ -2707,6 +2733,19 @@ public final class SmsManager {
* downloading the message.
* @param downloadedIntent if not NULL this <code>PendingIntent</code> is
* broadcast when the message is downloaded, or the download is failed
+ * The result code will be <code>Activity.RESULT_OK</code> for success
+ * or one of these errors:<br>
+ * <code>MMS_ERROR_UNSPECIFIED</code><br>
+ * <code>MMS_ERROR_INVALID_APN</code><br>
+ * <code>MMS_ERROR_UNABLE_CONNECT_MMS</code><br>
+ * <code>MMS_ERROR_HTTP_FAILURE</code><br>
+ * <code>MMS_ERROR_IO_ERROR</code><br>
+ * <code>MMS_ERROR_RETRY</code><br>
+ * <code>MMS_ERROR_CONFIGURATION_ERROR</code><br>
+ * <code>MMS_ERROR_NO_DATA_NETWORK</code><br>
+ * <code>MMS_ERROR_INVALID_SUBSCRIPTION_ID</code><br>
+ * <code>MMS_ERROR_INACTIVE_SUBSCRIPTION</code><br>
+ * <code>MMS_ERROR_DATA_DISABLED</code><br>
* @throws IllegalArgumentException if locationUrl or contentUri is empty
*/
public void downloadMultimediaMessage(Context context, String locationUrl, Uri contentUri,
@@ -2737,6 +2776,19 @@ public final class SmsManager {
* downloading the message.
* @param downloadedIntent if not NULL this <code>PendingIntent</code> is
* broadcast when the message is downloaded, or the download is failed
+ * The result code will be <code>Activity.RESULT_OK</code> for success
+ * or one of these errors:<br>
+ * <code>MMS_ERROR_UNSPECIFIED</code><br>
+ * <code>MMS_ERROR_INVALID_APN</code><br>
+ * <code>MMS_ERROR_UNABLE_CONNECT_MMS</code><br>
+ * <code>MMS_ERROR_HTTP_FAILURE</code><br>
+ * <code>MMS_ERROR_IO_ERROR</code><br>
+ * <code>MMS_ERROR_RETRY</code><br>
+ * <code>MMS_ERROR_CONFIGURATION_ERROR</code><br>
+ * <code>MMS_ERROR_NO_DATA_NETWORK</code><br>
+ * <code>MMS_ERROR_INVALID_SUBSCRIPTION_ID</code><br>
+ * <code>MMS_ERROR_INACTIVE_SUBSCRIPTION</code><br>
+ * <code>MMS_ERROR_DATA_DISABLED</code><br>
* @param messageId an id that uniquely identifies the message requested to be downloaded.
* Used for logging and diagnostics purposes. The id may be 0.
* @throws IllegalArgumentException if locationUrl or contentUri is empty
@@ -2768,15 +2820,62 @@ public final class SmsManager {
}
// MMS send/download failure result codes
+
+ /**
+ * Unspecific MMS error occurred during send/download.
+ */
public static final int MMS_ERROR_UNSPECIFIED = 1;
+
+ /**
+ * ApnException occurred during MMS network setup.
+ */
public static final int MMS_ERROR_INVALID_APN = 2;
+
+ /**
+ * An error occurred during the MMS connection setup.
+ */
public static final int MMS_ERROR_UNABLE_CONNECT_MMS = 3;
+
+ /**
+ * An error occurred during the HTTP client setup.
+ */
public static final int MMS_ERROR_HTTP_FAILURE = 4;
+
+ /**
+ * An I/O error occurred reading the PDU.
+ */
public static final int MMS_ERROR_IO_ERROR = 5;
+
+ /**
+ * An error occurred while retrying sending/downloading the MMS.
+ */
public static final int MMS_ERROR_RETRY = 6;
+
+ /**
+ * The carrier-dependent configuration values could not be loaded.
+ */
public static final int MMS_ERROR_CONFIGURATION_ERROR = 7;
+
+ /**
+ * There is no data network.
+ */
public static final int MMS_ERROR_NO_DATA_NETWORK = 8;
+ /**
+ * The subscription id for the send/download is invalid.
+ */
+ public static final int MMS_ERROR_INVALID_SUBSCRIPTION_ID = 9;
+
+ /**
+ * The subscription id for the send/download is inactive.
+ */
+ public static final int MMS_ERROR_INACTIVE_SUBSCRIPTION = 10;
+
+ /**
+ * Data is disabled for the MMS APN.
+ */
+ public static final int MMS_ERROR_DATA_DISABLED = 11;
+
/** Intent extra name for MMS sending result data in byte array type */
public static final String EXTRA_MMS_DATA = "android.telephony.extra.MMS_DATA";
/** Intent extra name for HTTP status code for MMS HTTP failure in integer type */