1 /* 2 * Copyright 2007, 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 17 package com.android.internal.telephony; 18 19 import android.app.PendingIntent; 20 import android.net.Uri; 21 import android.os.Bundle; 22 import com.android.internal.telephony.SmsRawData; 23 24 /** 25 * Service interface to handle SMS API requests 26 * 27 * See also SmsManager.java. 28 */ 29 interface ISms { 30 /** 31 * Retrieves all messages currently stored on ICC. 32 * @param subId the subId id. 33 * @return list of SmsRawData of all sms on ICC 34 */ getAllMessagesFromIccEfForSubscriber(in int subId, String callingPkg)35 List<SmsRawData> getAllMessagesFromIccEfForSubscriber(in int subId, String callingPkg); 36 37 /** 38 * Update the specified message on the ICC. 39 * 40 * @param messageIndex record index of message to update 41 * @param newStatus new message status (STATUS_ON_ICC_READ, 42 * STATUS_ON_ICC_UNREAD, STATUS_ON_ICC_SENT, 43 * STATUS_ON_ICC_UNSENT, STATUS_ON_ICC_FREE) 44 * @param pdu the raw PDU to store 45 * @param subId the subId id. 46 * @return success or not 47 * 48 */ updateMessageOnIccEfForSubscriber(in int subId, String callingPkg, int messageIndex, int newStatus, in byte[] pdu)49 boolean updateMessageOnIccEfForSubscriber(in int subId, String callingPkg, 50 int messageIndex, int newStatus, in byte[] pdu); 51 52 /** 53 * Copy a raw SMS PDU to the ICC. 54 * 55 * @param pdu the raw PDU to store 56 * @param status message status (STATUS_ON_ICC_READ, STATUS_ON_ICC_UNREAD, 57 * STATUS_ON_ICC_SENT, STATUS_ON_ICC_UNSENT) 58 * @param subId the subId id. 59 * @return success or not 60 * 61 */ copyMessageToIccEfForSubscriber(in int subId, String callingPkg, int status, in byte[] pdu, in byte[] smsc)62 boolean copyMessageToIccEfForSubscriber(in int subId, String callingPkg, int status, 63 in byte[] pdu, in byte[] smsc); 64 65 /** 66 * Send a data SMS. 67 * 68 * @param smsc the SMSC to send the message through, or NULL for the 69 * default SMSC 70 * @param data the body of the message to send 71 * @param sentIntent if not NULL this <code>PendingIntent</code> is 72 * broadcast when the message is sucessfully sent, or failed. 73 * The result code will be <code>Activity.RESULT_OK<code> for success, 74 * or one of these errors:<br> 75 * <code>RESULT_ERROR_GENERIC_FAILURE</code><br> 76 * <code>RESULT_ERROR_RADIO_OFF</code><br> 77 * <code>RESULT_ERROR_NULL_PDU</code><br> 78 * For <code>RESULT_ERROR_GENERIC_FAILURE</code> the sentIntent may include 79 * the extra "errorCode" containing a radio technology specific value, 80 * generally only useful for troubleshooting.<br> 81 * The per-application based SMS control checks sentIntent. If sentIntent 82 * is NULL the caller will be checked against all unknown applicaitons, 83 * which cause smaller number of SMS to be sent in checking period. 84 * @param deliveryIntent if not NULL this <code>PendingIntent</code> is 85 * broadcast when the message is delivered to the recipient. The 86 * raw pdu of the status report is in the extended data ("pdu"). 87 * @param subId the subId id. 88 */ sendDataForSubscriber(int subId, String callingPkg, String callingattributionTag, in String destAddr, in String scAddr, in int destPort,in byte[] data, in PendingIntent sentIntent, in PendingIntent deliveryIntent)89 void sendDataForSubscriber(int subId, String callingPkg, String callingattributionTag, 90 in String destAddr, in String scAddr, in int destPort,in byte[] data, 91 in PendingIntent sentIntent, in PendingIntent deliveryIntent); 92 93 /** 94 * Send an SMS. 95 * 96 * @param smsc the SMSC to send the message through, or NULL for the 97 * default SMSC 98 * @param text the body of the message to send 99 * @param sentIntent if not NULL this <code>PendingIntent</code> is 100 * broadcast when the message is sucessfully sent, or failed. 101 * The result code will be <code>Activity.RESULT_OK<code> for success, 102 * or one of these errors:<br> 103 * <code>RESULT_ERROR_GENERIC_FAILURE</code><br> 104 * <code>RESULT_ERROR_RADIO_OFF</code><br> 105 * <code>RESULT_ERROR_NULL_PDU</code><br> 106 * For <code>RESULT_ERROR_GENERIC_FAILURE</code> the sentIntent may include 107 * the extra "errorCode" containing a radio technology specific value, 108 * generally only useful for troubleshooting.<br> 109 * The per-application based SMS control checks sentIntent. If sentIntent 110 * is NULL the caller will be checked against all unknown applications, 111 * which cause smaller number of SMS to be sent in checking period. 112 * @param deliveryIntent if not NULL this <code>PendingIntent</code> is 113 * broadcast when the message is delivered to the recipient. The 114 * raw pdu of the status report is in the extended data ("pdu"). 115 * @param subId the subId on which the SMS has to be sent. 116 * @param persistMessageForNonDefaultSmsApp whether the sent message should 117 * be automatically persisted in the SMS db. It only affects messages sent 118 * by a non-default SMS app. Currently only the carrier app can set this 119 * parameter to false to skip auto message persistence. 120 */ sendTextForSubscriber(in int subId, String callingPkg, String callingAttributionTag, in String destAddr, in String scAddr, in String text, in PendingIntent sentIntent, in PendingIntent deliveryIntent, in boolean persistMessageForNonDefaultSmsApp)121 void sendTextForSubscriber(in int subId, String callingPkg, String callingAttributionTag, 122 in String destAddr, in String scAddr, in String text, in PendingIntent sentIntent, 123 in PendingIntent deliveryIntent, in boolean persistMessageForNonDefaultSmsApp); 124 125 /** 126 * Send an SMS with options using Subscription Id. 127 * 128 * @param subId the subId on which the SMS has to be sent. 129 * @param destAddr the address to send the message to 130 * @param scAddr the SMSC to send the message through, or NULL for the 131 * default SMSC 132 * @param text the body of the message to send 133 * @param sentIntent if not NULL this <code>PendingIntent</code> is 134 * broadcast when the message is sucessfully sent, or failed. 135 * The result code will be <code>Activity.RESULT_OK<code> for success, 136 * or one of these errors:<br> 137 * <code>RESULT_ERROR_GENERIC_FAILURE</code><br> 138 * <code>RESULT_ERROR_RADIO_OFF</code><br> 139 * <code>RESULT_ERROR_NULL_PDU</code><br> 140 * For <code>RESULT_ERROR_GENERIC_FAILURE</code> the sentIntent may include 141 * the extra "errorCode" containing a radio technology specific value, 142 * generally only useful for troubleshooting.<br> 143 * The per-application based SMS control checks sentIntent. If sentIntent 144 * is NULL the caller will be checked against all unknown applications, 145 * which cause smaller number of SMS to be sent in checking period. 146 * @param deliveryIntent if not NULL this <code>PendingIntent</code> is 147 * broadcast when the message is delivered to the recipient. The 148 * raw pdu of the status report is in the extended data ("pdu"). 149 * @param persistMessageForNonDefaultSmsApp whether the sent message should 150 * be automatically persisted in the SMS db. It only affects messages sent 151 * by a non-default SMS app. Currently only the carrier app can set this 152 * parameter to false to skip auto message persistence. 153 * @param priority Priority level of the message 154 * Refer specification See 3GPP2 C.S0015-B, v2.0, table 4.5.9-1 155 * --------------------------------- 156 * PRIORITY | Level of Priority 157 * --------------------------------- 158 * '00' | Normal 159 * '01' | Interactive 160 * '10' | Urgent 161 * '11' | Emergency 162 * ---------------------------------- 163 * Any Other values included Negative considered as Invalid Priority Indicator of the message. 164 * @param expectMore is a boolean to indicate the sending message is multi segmented or not. 165 * @param validityPeriod Validity Period of the message in mins. 166 * Refer specification 3GPP TS 23.040 V6.8.1 section 9.2.3.12.1. 167 * Validity Period(Minimum) -> 5 mins 168 * Validity Period(Maximum) -> 635040 mins(i.e.63 weeks). 169 * Any Other values included Negative considered as Invalid Validity Period of the message. 170 */ sendTextForSubscriberWithOptions(in int subId, String callingPkg, String callingAttributionTag, in String destAddr, in String scAddr, in String text, in PendingIntent sentIntent, in PendingIntent deliveryIntent, in boolean persistMessageForNonDefaultSmsApp, in int priority, in boolean expectMore, in int validityPeriod)171 void sendTextForSubscriberWithOptions(in int subId, String callingPkg, 172 String callingAttributionTag, in String destAddr, in String scAddr, in String text, 173 in PendingIntent sentIntent, in PendingIntent deliveryIntent, 174 in boolean persistMessageForNonDefaultSmsApp, in int priority, in boolean expectMore, 175 in int validityPeriod); 176 177 /** 178 * Inject an SMS PDU into the android platform. 179 * 180 * @param subId the subId on which the SMS has to be injected. 181 * @param pdu is the byte array of pdu to be injected into android application framework 182 * @param format is the format of SMS pdu (android.telephony.SmsMessage.FORMAT_3GPP or 183 * android.telephony.SmsMessage.FORMAT_3GPP2) 184 * @param receivedIntent if not NULL this <code>PendingIntent</code> is 185 * broadcast when the message is successfully received by the 186 * android application framework. This intent is broadcasted at 187 * the same time an SMS received from radio is acknowledged back. 188 */ injectSmsPduForSubscriber( int subId, in byte[] pdu, String format, in PendingIntent receivedIntent)189 void injectSmsPduForSubscriber( 190 int subId, in byte[] pdu, String format, in PendingIntent receivedIntent); 191 192 /** 193 * Send a multi-part text based SMS. 194 * 195 * @param destinationAddress the address to send the message to 196 * @param scAddress is the service center address or null to use 197 * the current default SMSC 198 * @param parts an <code>ArrayList</code> of strings that, in order, 199 * comprise the original message 200 * @param sentIntents if not null, an <code>ArrayList</code> of 201 * <code>PendingIntent</code>s (one for each message part) that is 202 * broadcast when the corresponding message part has been sent. 203 * The result code will be <code>Activity.RESULT_OK<code> for success, 204 * or one of these errors: 205 * <code>RESULT_ERROR_GENERIC_FAILURE</code> 206 * <code>RESULT_ERROR_RADIO_OFF</code> 207 * <code>RESULT_ERROR_NULL_PDU</code>. 208 * @param deliveryIntents if not null, an <code>ArrayList</code> of 209 * <code>PendingIntent</code>s (one for each message part) that is 210 * broadcast when the corresponding message part has been delivered 211 * to the recipient. The raw pdu of the status report is in the 212 * extended data ("pdu"). 213 * @param subId the subId on which the SMS has to be sent. 214 * @param persistMessageForNonDefaultSmsApp whether the sent message should 215 * be automatically persisted in the SMS db. It only affects messages sent 216 * by a non-default SMS app. Currently only the carrier app can set this 217 * parameter to false to skip auto message persistence. 218 */ sendMultipartTextForSubscriber(in int subId, String callingPkg, String callingAttributionTag, in String destinationAddress, in String scAddress, in List<String> parts, in List<PendingIntent> sentIntents, in List<PendingIntent> deliveryIntents, in boolean persistMessageForNonDefaultSmsApp)219 void sendMultipartTextForSubscriber(in int subId, String callingPkg, 220 String callingAttributionTag, in String destinationAddress, in String scAddress, 221 in List<String> parts, in List<PendingIntent> sentIntents, 222 in List<PendingIntent> deliveryIntents, in boolean persistMessageForNonDefaultSmsApp); 223 224 /** 225 * Send a multi-part text based SMS with options using Subscription Id. 226 * 227 * @param subId the subId on which the SMS has to be sent. 228 * @param destinationAddress the address to send the message to 229 * @param scAddress is the service center address or null to use 230 * the current default SMSC 231 * @param parts an <code>ArrayList</code> of strings that, in order, 232 * comprise the original message 233 * @param sentIntents if not null, an <code>ArrayList</code> of 234 * <code>PendingIntent</code>s (one for each message part) that is 235 * broadcast when the corresponding message part has been sent. 236 * The result code will be <code>Activity.RESULT_OK<code> for success, 237 * or one of these errors: 238 * <code>RESULT_ERROR_GENERIC_FAILURE</code> 239 * <code>RESULT_ERROR_RADIO_OFF</code> 240 * <code>RESULT_ERROR_NULL_PDU</code>. 241 * @param deliveryIntents if not null, an <code>ArrayList</code> of 242 * <code>PendingIntent</code>s (one for each message part) that is 243 * broadcast when the corresponding message part has been delivered 244 * to the recipient. The raw pdu of the status report is in the 245 * extended data ("pdu"). 246 * @param persistMessageForNonDefaultSmsApp whether the sent message should 247 * be automatically persisted in the SMS db. It only affects messages sent 248 * by a non-default SMS app. Currently only the carrier app can set this 249 * parameter to false to skip auto message persistence. 250 * @param priority Priority level of the message 251 * Refer specification See 3GPP2 C.S0015-B, v2.0, table 4.5.9-1 252 * --------------------------------- 253 * PRIORITY | Level of Priority 254 * --------------------------------- 255 * '00' | Normal 256 * '01' | Interactive 257 * '10' | Urgent 258 * '11' | Emergency 259 * ---------------------------------- 260 * Any Other values included Negative considered as Invalid Priority Indicator of the message. 261 * @param expectMore is a boolean to indicate the sending message is multi segmented or not. 262 * @param validityPeriod Validity Period of the message in mins. 263 * Refer specification 3GPP TS 23.040 V6.8.1 section 9.2.3.12.1. 264 * Validity Period(Minimum) -> 5 mins 265 * Validity Period(Maximum) -> 635040 mins(i.e.63 weeks). 266 * Any Other values included Negative considered as Invalid Validity Period of the message. 267 */ sendMultipartTextForSubscriberWithOptions(in int subId, String callingPkg, String callingAttributionTag, in String destinationAddress, in String scAddress, in List<String> parts, in List<PendingIntent> sentIntents, in List<PendingIntent> deliveryIntents, in boolean persistMessageForNonDefaultSmsApp, in int priority, in boolean expectMore, in int validityPeriod)268 void sendMultipartTextForSubscriberWithOptions(in int subId, String callingPkg, 269 String callingAttributionTag, in String destinationAddress, in String scAddress, 270 in List<String> parts, in List<PendingIntent> sentIntents, 271 in List<PendingIntent> deliveryIntents, in boolean persistMessageForNonDefaultSmsApp, 272 in int priority, in boolean expectMore, in int validityPeriod); 273 274 /** 275 * Enable reception of cell broadcast (SMS-CB) messages with the given 276 * message identifier and RAN type. The RAN type specify this message ID 277 * belong to 3GPP (GSM) or 3GPP2(CDMA). Note that if two different clients 278 * enable the same message identifier, they must both disable it for the 279 * device to stop receiving those messages. 280 * 281 * @param messageIdentifier Message identifier as specified in TS 23.041 (3GPP) or 282 * C.R1001-G (3GPP2) 283 * @param subId for which the broadcast has to be enabled 284 * @param ranType as defined in class SmsManager, the value can be one of these: 285 * android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_GSM 286 * android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_CDMA 287 * @return true if successful, false otherwise 288 * 289 * @see #disableCellBroadcastForSubscriber(int, int, int) 290 */ enableCellBroadcastForSubscriber(int subId, int messageIdentifier, int ranType)291 boolean enableCellBroadcastForSubscriber(int subId, int messageIdentifier, int ranType); 292 293 /** 294 * Disable reception of cell broadcast (SMS-CB) messages with the given 295 * message identifier and RAN type. The RAN type specify this message ID 296 * belong to 3GPP (GSM) or 3GPP2(CDMA). Note that if two different clients 297 * enable the same message identifier, they must both disable it for the 298 * device to stop receiving those messages. 299 * 300 * @param messageIdentifier Message identifier as specified in TS 23.041 (3GPP) or 301 * C.R1001-G (3GPP2) 302 * @param subId for which the broadcast has to be disabled 303 * @param ranType as defined in class SmsManager, the value can be one of these: 304 * android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_GSM 305 * android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_CDMA 306 * @return true if successful, false otherwise 307 * 308 * @see #enableCellBroadcastForSubscriber(int, int, int) 309 */ disableCellBroadcastForSubscriber(int subId, int messageIdentifier, int ranType)310 boolean disableCellBroadcastForSubscriber(int subId, int messageIdentifier, int ranType); 311 312 /* 313 * Enable reception of cell broadcast (SMS-CB) messages with the given 314 * message identifier range and RAN type. The RAN type specify this message ID range 315 * belong to 3GPP (GSM) or 3GPP2(CDMA). Note that if two different clients enable 316 * a message identifier range, they must both disable it for the device 317 * to stop receiving those messages. 318 * 319 * @param startMessageId first message identifier as specified in TS 23.041 (3GPP) or 320 * C.R1001-G (3GPP2) 321 * @param endMessageId last message identifier as specified in TS 23.041 (3GPP) or 322 * C.R1001-G (3GPP2) 323 * @param subId for which the broadcast has to be enabled 324 * @param ranType as defined in class SmsManager, the value can be one of these: 325 * android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_GSM 326 * android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_CDMA 327 * @return true if successful, false otherwise 328 * 329 * @see #disableCellBroadcastRangeForSubscriber(int, int, int, int) 330 */ enableCellBroadcastRangeForSubscriber(int subId, int startMessageId, int endMessageId, int ranType)331 boolean enableCellBroadcastRangeForSubscriber(int subId, int startMessageId, int endMessageId, 332 int ranType); 333 334 /** 335 * Disable reception of cell broadcast (SMS-CB) messages with the given 336 * message identifier range and RAN type. The RAN type specify this message ID range 337 * belong to 3GPP (GSM) or 3GPP2(CDMA). Note that if two different clients enable 338 * a message identifier range, they must both disable it for the device 339 * to stop receiving those messages. 340 * 341 * @param startMessageId first message identifier as specified in TS 23.041 (3GPP) or 342 * C.R1001-G (3GPP2) 343 * @param endMessageId last message identifier as specified in TS 23.041 (3GPP) or 344 * C.R1001-G (3GPP2) 345 * @param subId for which the broadcast has to be disabled 346 * @param ranType as defined in class SmsManager, the value can be one of these: 347 * android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_GSM 348 * android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_CDMA 349 * @return true if successful, false otherwise 350 * 351 * @see #enableCellBroadcastRangeForSubscriber(int, int, int, int) 352 */ disableCellBroadcastRangeForSubscriber(int subId, int startMessageId, int endMessageId, int ranType)353 boolean disableCellBroadcastRangeForSubscriber(int subId, int startMessageId, 354 int endMessageId, int ranType); 355 356 /** 357 * Returns the premium SMS send permission for the specified package. 358 * Requires system permission. 359 */ getPremiumSmsPermission(String packageName)360 int getPremiumSmsPermission(String packageName); 361 362 /** 363 * Returns the premium SMS send permission for the specified package. 364 * Requires system permission. 365 */ getPremiumSmsPermissionForSubscriber(int subId, String packageName)366 int getPremiumSmsPermissionForSubscriber(int subId, String packageName); 367 368 /** 369 * Set the SMS send permission for the specified package. 370 * Requires system permission. 371 */ setPremiumSmsPermission(String packageName, int permission)372 void setPremiumSmsPermission(String packageName, int permission); 373 374 /** 375 * Set the SMS send permission for the specified package. 376 * Requires system permission. 377 */ setPremiumSmsPermissionForSubscriber(int subId, String packageName, int permission)378 void setPremiumSmsPermissionForSubscriber(int subId, String packageName, int permission); 379 380 /** 381 * SMS over IMS is supported if IMS is registered and SMS is supported 382 * on IMS. 383 * @param subId for subId which isImsSmsSupported is queried 384 * @return true if SMS over IMS is supported, false otherwise 385 * 386 * @see #getImsSmsFormatForSubscriber(int) 387 */ isImsSmsSupportedForSubscriber(int subId)388 boolean isImsSmsSupportedForSubscriber(int subId); 389 390 /** 391 * User needs to pick SIM for SMS if multiple SIMs present and if current subId passed in is not 392 * active/valid. 393 * @param subId current subId for sending SMS 394 * @return true if SIM for SMS sending needs to be chosen 395 */ isSmsSimPickActivityNeeded(int subId)396 boolean isSmsSimPickActivityNeeded(int subId); 397 398 /* 399 * get user prefered SMS subId 400 * @return subId id 401 */ getPreferredSmsSubscription()402 int getPreferredSmsSubscription(); 403 404 /** 405 * Gets SMS format supported on IMS. SMS over IMS format is 406 * either 3GPP or 3GPP2. 407 * @param subId for subId which getImsSmsFormat is queried 408 * @return android.telephony.SmsMessage.FORMAT_3GPP, 409 * android.telephony.SmsMessage.FORMAT_3GPP2 410 * or android.telephony.SmsMessage.FORMAT_UNKNOWN 411 * 412 * @see #isImsSmsSupportedForSubscriber(int) 413 */ getImsSmsFormatForSubscriber(int subId)414 String getImsSmsFormatForSubscriber(int subId); 415 416 /* 417 * Get SMS prompt property, enabled or not 418 * @return true if enabled, false otherwise 419 */ isSMSPromptEnabled()420 boolean isSMSPromptEnabled(); 421 422 /** 423 * Send a system stored text message. 424 * 425 * This is used for sending a previously sent, but failed-to-send, message or 426 * for sending a text message that has been stored as a draft. 427 * 428 * @param subId the SIM id. 429 * @param callingPkg the package name of the calling app 430 * @param callingAttributionTag the attribution tag of calling context 431 * @param messageUri the URI of the stored message 432 * @param scAddress is the service center address or null to use the current default SMSC 433 * @param sentIntent if not NULL this <code>PendingIntent</code> is 434 * broadcast when the message is successfully sent, or failed. 435 * The result code will be <code>Activity.RESULT_OK</code> for success, 436 * or one of these errors:<br> 437 * <code>RESULT_ERROR_GENERIC_FAILURE</code><br> 438 * <code>RESULT_ERROR_RADIO_OFF</code><br> 439 * <code>RESULT_ERROR_NULL_PDU</code><br> 440 * For <code>RESULT_ERROR_GENERIC_FAILURE</code> the sentIntent may include 441 * the extra "errorCode" containing a radio technology specific value, 442 * generally only useful for troubleshooting.<br> 443 * The per-application based SMS control checks sentIntent. If sentIntent 444 * is NULL the caller will be checked against all unknown applications, 445 * which cause smaller number of SMS to be sent in checking period. 446 * @param deliveryIntent if not NULL this <code>PendingIntent</code> is 447 * broadcast when the message is delivered to the recipient. The 448 * raw pdu of the status report is in the extended data ("pdu"). 449 */ sendStoredText(int subId, String callingPkg, String callingAttributionTag, in Uri messageUri, String scAddress, in PendingIntent sentIntent, in PendingIntent deliveryIntent)450 void sendStoredText(int subId, String callingPkg, String callingAttributionTag, 451 in Uri messageUri, String scAddress, in PendingIntent sentIntent, 452 in PendingIntent deliveryIntent); 453 454 /** 455 * Send a system stored multi-part text message. 456 * 457 * This is used for sending a previously sent, but failed-to-send, message or 458 * for sending a text message that has been stored as a draft. 459 * The provided <code>PendingIntent</code> lists should match the part number of the 460 * divided text of the stored message by using <code>divideMessage</code> 461 * 462 * @param subId the SIM id. 463 * @param callingPkg the package name of the calling app 464 * @param callingAttributeTag the attribute tag of the calling context 465 * @param messageUri the URI of the stored message 466 * @param scAddress is the service center address or null to use 467 * the current default SMSC 468 * @param sentIntents if not null, an <code>ArrayList</code> of 469 * <code>PendingIntent</code>s (one for each message part) that is 470 * broadcast when the corresponding message part has been sent. 471 * The result code will be <code>Activity.RESULT_OK</code> for success, 472 * or one of these errors:<br> 473 * <code>RESULT_ERROR_GENERIC_FAILURE</code><br> 474 * <code>RESULT_ERROR_RADIO_OFF</code><br> 475 * <code>RESULT_ERROR_NULL_PDU</code><br> 476 * For <code>RESULT_ERROR_GENERIC_FAILURE</code> each sentIntent may include 477 * the extra "errorCode" containing a radio technology specific value, 478 * generally only useful for troubleshooting.<br> 479 * The per-application based SMS control checks sentIntent. If sentIntent 480 * is NULL the caller will be checked against all unknown applications, 481 * which cause smaller number of SMS to be sent in checking period. 482 * @param deliveryIntents if not null, an <code>ArrayList</code> of 483 * <code>PendingIntent</code>s (one for each message part) that is 484 * broadcast when the corresponding message part has been delivered 485 * to the recipient. The raw pdu of the status report is in the 486 * extended data ("pdu"). 487 */ sendStoredMultipartText(int subId, String callingPkg, String callingAttributeTag, in Uri messageUri, String scAddress, in List<PendingIntent> sentIntents, in List<PendingIntent> deliveryIntents)488 void sendStoredMultipartText(int subId, String callingPkg, String callingAttributeTag, 489 in Uri messageUri, String scAddress, in List<PendingIntent> sentIntents, 490 in List<PendingIntent> deliveryIntents); 491 492 /** 493 * Get carrier-dependent configuration values. 494 * 495 * @param subId the subscription Id 496 */ getCarrierConfigValuesForSubscriber(int subId)497 Bundle getCarrierConfigValuesForSubscriber(int subId); 498 499 /** 500 * Create an app-only incoming SMS request for the calling package. 501 * 502 * If an incoming text contains the token returned by this method the provided 503 * <code>PendingIntent</code> will be sent containing the SMS data. 504 * 505 * @param subId the SIM id. 506 * @param callingPkg the package name of the calling app. 507 * @param intent PendingIntent to be sent when an SMS is received containing the token. 508 */ createAppSpecificSmsToken(int subId, String callingPkg, in PendingIntent intent)509 String createAppSpecificSmsToken(int subId, String callingPkg, in PendingIntent intent); 510 511 /** 512 * Create an app-only incoming SMS request for the calling package. 513 * 514 * If an incoming text contains the token returned by this method the provided 515 * <code>PendingIntent</code> will be sent containing the SMS data. 516 * 517 * @param subId the SIM id. 518 * @param callingPkg the package name of the calling app. 519 * @param prefixes the caller provided prefixes 520 * @param intent PendingIntent to be sent when a SMS is received containing the token and one 521 * of the prefixes 522 */ createAppSpecificSmsTokenWithPackageInfo( int subId, String callingPkg, String prefixes, in PendingIntent intent)523 String createAppSpecificSmsTokenWithPackageInfo( 524 int subId, String callingPkg, String prefixes, in PendingIntent intent); 525 526 /** 527 * Check if the destination is a possible premium short code. 528 * 529 * @param destAddress the destination address to test for possible short code 530 */ checkSmsShortCodeDestination(int subId, String callingApk, String callingFeatureId, String destAddress, String countryIso)531 int checkSmsShortCodeDestination(int subId, String callingApk, String callingFeatureId, 532 String destAddress, String countryIso); 533 534 /** 535 * Gets the SMSC address from (U)SIM. 536 * 537 * @param subId the subscription Id. 538 * @param callingPackage the package name of the calling app. 539 * @return the SMSC address string, null if failed. 540 */ getSmscAddressFromIccEfForSubscriber(int subId, String callingPackage)541 String getSmscAddressFromIccEfForSubscriber(int subId, String callingPackage); 542 543 /** 544 * Sets the SMSC address on (U)SIM. 545 * 546 * @param smsc the SMSC address string. 547 * @param subId the subscription Id. 548 * @param callingPackage the package name of the calling app. 549 * @return true for success, false otherwise. 550 */ setSmscAddressOnIccEfForSubscriber(String smsc, int subId, String callingPackage)551 boolean setSmscAddressOnIccEfForSubscriber(String smsc, int subId, String callingPackage); 552 553 /** 554 * Get the capacity count of sms on Icc card. 555 * 556 * @param subId for subId which getSmsCapacityOnIcc is queried. 557 * @return capacity of ICC 558 */ getSmsCapacityOnIccForSubscriber(int subId)559 int getSmsCapacityOnIccForSubscriber(int subId); 560 } 561