IMms.aidl revision 31ef14d4f00b90e13a9755ecfa6cbe8aa7466da7
1/* 2 * Copyright (C) 2014 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17package com.android.internal.telephony; 18 19import android.app.PendingIntent; 20import android.content.ContentValues; 21import android.net.Uri; 22import android.os.Bundle; 23 24/** 25 * Service interface to handle MMS API requests 26 */ 27interface IMms { 28 /** 29 * Send an MMS message 30 * 31 * @param subId the SIM id 32 * @param callingPkg the package name of the calling app 33 * @param contentUri the content uri from which to read MMS message encoded in standard MMS 34 * PDU format 35 * @param locationUrl the optional location url for where this message should be sent to 36 * @param configOverrides the carrier-specific messaging configuration values to override for 37 * sending the message. See {@link android.telephony.MessagingConfigurationManager} for the 38 * value names and types. 39 * @param sentIntent if not NULL this <code>PendingIntent</code> is 40 * broadcast when the message is successfully sent, or failed 41 */ 42 void sendMessage(long subId, String callingPkg, in Uri contentUri, 43 String locationUrl, in ContentValues configOverrides, in PendingIntent sentIntent); 44 45 /** 46 * Download an MMS message using known location and transaction id 47 * 48 * @param subId the SIM id 49 * @param callingPkg the package name of the calling app 50 * @param locationUrl the location URL of the MMS message to be downloaded, usually obtained 51 * from the MMS WAP push notification 52 * @param contentUri a contentUri to which the downloaded MMS message will be written 53 * @param configOverrides the carrier-specific messaging configuration values to override for 54 * downloading the message. See {@link android.telephony.MessagingConfigurationManager} for the 55 * value names and types. 56 * @param downloadedIntent if not NULL this <code>PendingIntent</code> is 57 * broadcast when the message is downloaded, or the download is failed 58 */ 59 void downloadMessage(long subId, String callingPkg, String locationUrl, 60 in Uri contentUri, in ContentValues configOverrides, 61 in PendingIntent downloadedIntent); 62 63 /** 64 * Update the status of a pending (send-by-IP) MMS message handled by the carrier app. 65 * If the carrier app fails to send this message, it would be resent via carrier network. 66 * 67 * @param messageRef the reference number of the MMS message. 68 * @param success True if and only if the message was sent successfully. If its value is 69 * false, this message should be resent via carrier network 70 */ 71 void updateMmsSendStatus(int messageRef, boolean success); 72 73 /** 74 * Update the status of a pending (download-by-IP) MMS message handled by the carrier app. 75 * If the carrier app fails to download this message, it would be re-downloaded via carrier 76 * network. 77 * 78 * @param messageRef the reference number of the MMS message. 79 * @param pdu non-empty if downloaded successfully, otherwise, it is empty and the message 80 * will be downloaded via carrier network 81 */ 82 void updateMmsDownloadStatus(int messageRef, in byte[] pdu); 83 84 /** 85 * Get carrier-dependent configuration values. 86 * 87 * @param subId the SIM id 88 */ 89 Bundle getCarrierConfigValues(long subId); 90 91 /** 92 * Import a text message into system's SMS store 93 * 94 * @param callingPkg the calling app's package name 95 * @param address the destination address of the message 96 * @param type the type of the message 97 * @param text the message text 98 * @param timestampMillis the message timestamp in milliseconds 99 * @param seen if the message is seen 100 * @param read if the message is read 101 * @return the message URI, null if failed 102 */ 103 Uri importTextMessage(String callingPkg, String address, int type, String text, 104 long timestampMillis, boolean seen, boolean read); 105 106 /** 107 * Import a multimedia message into system's MMS store 108 * 109 * @param callingPkg the package name of the calling app 110 * @param contentUri the content uri from which to read PDU of the message to import 111 * @param messageId the optional message id 112 * @param timestampSecs the message timestamp in seconds 113 * @param seen if the message is seen 114 * @param read if the message is read 115 * @return the message URI, null if failed 116 */ 117 Uri importMultimediaMessage(String callingPkg, in Uri contentUri, String messageId, 118 long timestampSecs, boolean seen, boolean read); 119 120 /** 121 * Delete a system stored SMS or MMS message 122 * 123 * @param callingPkg the package name of the calling app 124 * @param messageUri the URI of the stored message 125 * @return true if deletion is successful, false otherwise 126 */ 127 boolean deleteStoredMessage(String callingPkg, in Uri messageUri); 128 129 /** 130 * Delete a system stored SMS or MMS thread 131 * 132 * @param callingPkg the package name of the calling app 133 * @param conversationId the ID of the message conversation 134 * @return true if deletion is successful, false otherwise 135 */ 136 boolean deleteStoredConversation(String callingPkg, long conversationId); 137 138 /** 139 * Update the status properties of a system stored SMS or MMS message, e.g. 140 * the read status of a message, etc. 141 * 142 * @param callingPkg the package name of the calling app 143 * @param messageUri the URI of the stored message 144 * @param statusValues a list of status properties in key-value pairs to update 145 * @return true if deletion is successful, false otherwise 146 */ 147 boolean updateStoredMessageStatus(String callingPkg, in Uri messageUri, 148 in ContentValues statusValues); 149 150 /** 151 * Archive or unarchive a stored conversation 152 * 153 * @param callingPkg the package name of the calling app 154 * @param conversationId the ID of the message conversation 155 * @param archived true to archive the conversation, false otherwise 156 * @return true if update is successful, false otherwise 157 */ 158 boolean archiveStoredConversation(String callingPkg, long conversationId, boolean archived); 159 160 /** 161 * Add a text message draft to system SMS store 162 * 163 * @param callingPkg the package name of the calling app 164 * @param address the destination address of message 165 * @param text the body of the message to send 166 * @return the URI of the stored draft message 167 */ 168 Uri addTextMessageDraft(String callingPkg, String address, String text); 169 170 /** 171 * Add a multimedia message draft to system MMS store 172 * 173 * @param callingPkg the package name of the calling app 174 * @param contentUri the content Uri from which to read PDU data of the draft MMS 175 * @return the URI of the stored draft message 176 */ 177 Uri addMultimediaMessageDraft(String callingPkg, in Uri contentUri); 178 179 /** 180 * Send a system stored MMS message 181 * 182 * This is used for sending a previously sent, but failed-to-send, message or 183 * for sending a text message that has been stored as a draft. 184 * 185 * @param subId the SIM id 186 * @param callingPkg the package name of the calling app 187 * @param messageUri the URI of the stored message 188 * @param configOverrides the carrier-specific messaging configuration values to override for 189 * sending the message. See {@link android.telephony.MessagingConfigurationManager} for the 190 * value names and types. 191 * @param sentIntent if not NULL this <code>PendingIntent</code> is 192 * broadcast when the message is successfully sent, or failed 193 */ 194 void sendStoredMessage(long subId, String callingPkg, in Uri messageUri, 195 in ContentValues configOverrides, in PendingIntent sentIntent); 196 197 /** 198 * Turns on/off the flag to automatically write sent/received SMS/MMS messages into system 199 * 200 * When this flag is on, all SMS/MMS sent/received are stored by system automatically 201 * When this flag is off, only SMS/MMS sent by non-default SMS apps are stored by system 202 * automatically 203 * 204 * This flag can only be changed by default SMS apps 205 * 206 * @param callingPkg the name of the calling app package 207 * @param enabled Whether to enable message auto persisting 208 */ 209 void setAutoPersisting(String callingPkg, boolean enabled); 210 211 /** 212 * Get the value of the flag to automatically write sent/received SMS/MMS messages into system 213 * 214 * When this flag is on, all SMS/MMS sent/received are stored by system automatically 215 * When this flag is off, only SMS/MMS sent by non-default SMS apps are stored by system 216 * automatically 217 * 218 * @return the current value of the auto persist flag 219 */ 220 boolean getAutoPersisting(); 221} 222