From 8ee8d882acec0544ec39330954db4040bce66a06 Mon Sep 17 00:00:00 2001 From: Ye Wen Date: Wed, 9 Jul 2014 16:51:49 -0700 Subject: [PATCH] New SMS and MMS APIs and semantics (1/4) API changes for SMS and MMS AIDLs b/14095333 Change-Id: I04f05c1952135cb4b5d422df060ca4054c14e5e5 --- .../com/android/internal/telephony/IMms.aidl | 154 +++++++++++++++++- .../com/android/internal/telephony/ISms.aidl | 72 +++++++- 2 files changed, 220 insertions(+), 6 deletions(-) diff --git a/telephony/java/com/android/internal/telephony/IMms.aidl b/telephony/java/com/android/internal/telephony/IMms.aidl index 4da90a5c9bd72..db93a4f879849 100644 --- a/telephony/java/com/android/internal/telephony/IMms.aidl +++ b/telephony/java/com/android/internal/telephony/IMms.aidl @@ -17,6 +17,8 @@ package com.android.internal.telephony; import android.app.PendingIntent; +import android.content.ContentValues; +import android.net.Uri; /** * Service interface to handle MMS API requests @@ -25,25 +27,28 @@ interface IMms { /** * Send an MMS message * + * @param subId the SIM id * @param callingPkg the package name of the calling app * @param pdu the MMS message encoded in standard MMS PDU format * @param locationUrl the optional location url for where this message should be sent to * @param sentIntent if not NULL this PendingIntent is * broadcast when the message is successfully sent, or failed */ - void sendMessage(String callingPkg, in byte[] pdu, String locationUrl, + void sendMessage(long subId, String callingPkg, in byte[] pdu, String locationUrl, in PendingIntent sentIntent); /** * Download an MMS message using known location and transaction id * + * @param subId the SIM id * @param callingPkg the package name of the calling app * @param locationUrl the location URL of the MMS message to be downloaded, usually obtained * from the MMS WAP push notification * @param downloadedIntent if not NULL this PendingIntent is * broadcast when the message is downloaded, or the download is failed */ - void downloadMessage(String callingPkg, String locationUrl, in PendingIntent downloadedIntent); + void downloadMessage(long subId, String callingPkg, String locationUrl, + in PendingIntent downloadedIntent); /** * Update the status of a pending (send-by-IP) MMS message handled by the carrier app. @@ -65,4 +70,149 @@ interface IMms { * will be downloaded via carrier network */ void updateMmsDownloadStatus(int messageRef, in byte[] pdu); + + /** + * Get carrier-dependent configuration value as boolean. For example, if multipart SMS + * is supported. + * + * @param name the configuration name + * @param defaultValue the default value if fail to find the name + */ + boolean getCarrierConfigBoolean(String name, boolean defaultValue); + + /** + * Get carrier-dependent configuration value as int. For example, the MMS message size limit. + * + * @param name the configuration name + * @param defaultValue the default value if fail to find the name + */ + int getCarrierConfigInt(String name, int defaultValue); + + /** + * Get carrier-dependent configuration value as String. For example, extra HTTP headers for + * MMS request. + * + * @param name the configuration name + * @param defaultValue the default value if fail to find the name + */ + String getCarrierConfigString(String name, String defaultValue); + + /** + * Set carrier-dependent configuration value as boolean. For example, if multipart SMS + * is supported. + * + * @param name the configuration name + * @param value the configuration value + */ + void setCarrierConfigBoolean(String callingPkg, String name, boolean value); + + /** + * Set carrier-dependent configuration value as int. For example, the MMS message size limit. + * + * @param name the configuration name + * @param value the configuration value + */ + void setCarrierConfigInt(String callingPkg, String name, int value); + + /** + * Set carrier-dependent configuration value as String. For example, extra HTTP headers for + * MMS request. + * + * @param name the configuration name + * @param value the configuration value + */ + void setCarrierConfigString(String callingPkg, String name, String value); + + /** + * Import a text message into system's SMS store + * + * @param callingPkg the calling app's package name + * @param address the destination address of the message + * @param type the type of the message + * @param text the message text + * @param timestampMillis the message timestamp in milliseconds + * @param seen if the message is seen + * @param read if the message is read + * @return the message URI, null if failed + */ + Uri importTextMessage(String callingPkg, String address, int type, String text, + long timestampMillis, boolean seen, boolean read); + + /** + * Import a multimedia message into system's MMS store + * + * @param callingPkg the package name of the calling app + * @param pdu the PDU of the message to import + * @param messageId the optional message id + * @param timestampSecs the message timestamp in seconds + * @param seen if the message is seen + * @param read if the message is read + * @return the message URI, null if failed + */ + Uri importMultimediaMessage(String callingPkg, in byte[] pdu, String messageId, + long timestampSecs, boolean seen, boolean read); + + /** + * Delete a system stored SMS or MMS message + * + * @param callingPkg the package name of the calling app + * @param messageUri the URI of the stored message + * @return true if deletion is successful, false otherwise + */ + boolean deleteStoredMessage(String callingPkg, in Uri messageUri); + + /** + * Delete a system stored SMS or MMS thread + * + * @param callingPkg the package name of the calling app + * @param conversationId the ID of the message conversation + * @return true if deletion is successful, false otherwise + */ + boolean deleteStoredConversation(String callingPkg, long conversationId); + + /** + * Update the status properties of a system stored SMS or MMS message, e.g. + * the read status of a message, etc. + * + * @param callingPkg the package name of the calling app + * @param messageUri the URI of the stored message + * @param statusValues a list of status properties in key-value pairs to update + * @return true if deletion is successful, false otherwise + */ + boolean updateStoredMessageStatus(String callingPkg, in Uri messageUri, + in ContentValues statusValues); + + /** + * Add a text message draft to system SMS store + * + * @param callingPkg the package name of the calling app + * @param address the destination address of message + * @param text the body of the message to send + * @return the URI of the stored draft message + */ + Uri addTextMessageDraft(String callingPkg, String address, String text); + + /** + * Add a multimedia message draft to system MMS store + * + * @param callingPkg the package name of the calling app + * @param pdu the PDU data of the draft MMS + * @return the URI of the stored draft message + */ + Uri addMultimediaMessageDraft(String callingPkg, in byte[] pdu); + + /** + * Send a system stored MMS message + * + * This is used for sending a previously sent, but failed-to-send, message or + * for sending a text message that has been stored as a draft. + * + * @param subId the SIM id + * @param callingPkg the package name of the calling app + * @param messageUri the URI of the stored message + * @param sentIntent if not NULL this PendingIntent is + * broadcast when the message is successfully sent, or failed + */ + void sendStoredMessage(long subId, String callingPkg, in Uri messageUri, + in PendingIntent sentIntent); } diff --git a/telephony/java/com/android/internal/telephony/ISms.aidl b/telephony/java/com/android/internal/telephony/ISms.aidl index 53429b6351c03..abbdc4ab04932 100644 --- a/telephony/java/com/android/internal/telephony/ISms.aidl +++ b/telephony/java/com/android/internal/telephony/ISms.aidl @@ -17,6 +17,7 @@ package com.android.internal.telephony; import android.app.PendingIntent; +import android.net.Uri; import com.android.internal.telephony.SmsRawData; /** Interface for applications to access the ICC phone book. @@ -466,7 +467,6 @@ interface ISms { */ long getPreferredSmsSubscription(); - /** * Gets SMS format supported on IMS. SMS over IMS format is * either 3GPP or 3GPP2. @@ -491,12 +491,76 @@ interface ISms { */ String getImsSmsFormatUsingSubId(long subId); - - - /* * Get SMS prompt property, enabled or not * @return true if enabled, false otherwise */ boolean isSMSPromptEnabled(); + + /** + * Send a system stored text message. + * + * This is used for sending a previously sent, but failed-to-send, message or + * for sending a text message that has been stored as a draft. + * + * @param subId the SIM id. + * @param callingPkg the package name of the calling app + * @param messageUri the URI of the stored message + * @param scAddress is the service center address or null to use the current default SMSC + * @param sentIntent if not NULL this PendingIntent is + * broadcast when the message is successfully sent, or failed. + * The result code will be Activity.RESULT_OK for success, + * or one of these errors:
+ * RESULT_ERROR_GENERIC_FAILURE
+ * RESULT_ERROR_RADIO_OFF
+ * RESULT_ERROR_NULL_PDU
+ * For RESULT_ERROR_GENERIC_FAILURE the sentIntent may include + * the extra "errorCode" containing a radio technology specific value, + * generally only useful for troubleshooting.
+ * The per-application based SMS control checks sentIntent. If sentIntent + * is NULL the caller will be checked against all unknown applications, + * which cause smaller number of SMS to be sent in checking period. + * @param deliveryIntent if not NULL this PendingIntent is + * broadcast when the message is delivered to the recipient. The + * raw pdu of the status report is in the extended data ("pdu"). + */ + void sendStoredText(long subId, String callingPkg, in Uri messageUri, String scAddress, + in PendingIntent sentIntent, in PendingIntent deliveryIntent); + + /** + * Send a system stored multi-part text message. + * + * This is used for sending a previously sent, but failed-to-send, message or + * for sending a text message that has been stored as a draft. + * The provided PendingIntent lists should match the part number of the + * divided text of the stored message by using divideMessage + * + * @param subId the SIM id. + * @param callingPkg the package name of the calling app + * @param messageUri the URI of the stored message + * @param scAddress is the service center address or null to use + * the current default SMSC + * @param sentIntents if not null, an ArrayList of + * PendingIntents (one for each message part) that is + * broadcast when the corresponding message part has been sent. + * The result code will be Activity.RESULT_OK for success, + * or one of these errors:
+ * RESULT_ERROR_GENERIC_FAILURE
+ * RESULT_ERROR_RADIO_OFF
+ * RESULT_ERROR_NULL_PDU
+ * For RESULT_ERROR_GENERIC_FAILURE each sentIntent may include + * the extra "errorCode" containing a radio technology specific value, + * generally only useful for troubleshooting.
+ * The per-application based SMS control checks sentIntent. If sentIntent + * is NULL the caller will be checked against all unknown applications, + * which cause smaller number of SMS to be sent in checking period. + * @param deliveryIntents if not null, an ArrayList of + * PendingIntents (one for each message part) that is + * broadcast when the corresponding message part has been delivered + * to the recipient. The raw pdu of the status report is in the + * extended data ("pdu"). + */ + void sendStoredMultipartText(long subId, String callingPkg, in Uri messageUri, + String scAddress, in List sentIntents, + in List deliveryIntents); }