1/* 2 * Copyright (C) 2021-2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16/** 17 * @file 18 * @kit TelephonyKit 19 */ 20 21import type { AsyncCallback } from './@ohos.base'; 22import type Context from './application/BaseContext'; 23 24/** 25 * Provides the capabilities and methods for obtaining Short Message Service (SMS) management objects. 26 * 27 * @namespace sms 28 * @syscap SystemCapability.Telephony.SmsMms 29 * @since 6 30 */ 31declare namespace sms { 32 /** 33 * Splits a long SMS message into multiple fragments. 34 * 35 * <p>If the length of an SMS message exceeds the maximum length allowed (140 bytes), 36 * the SMS message is split into multiple segments for processing. 37 * 38 * @permission ohos.permission.SEND_MESSAGES 39 * @param { string } content - Indicates the short message content, which cannot be {@code null}. 40 * @param { AsyncCallback<Array<string>> } callback - Indicates the callback for getting a list of split segments, 41 * which can be combined into a complete SMS message; 42 * Returns an empty string if no permission is granted or the short message content is {@code null}. 43 * @throws { BusinessError } 201 - Permission denied. 44 * @throws { BusinessError } 202 - Non-system applications use system APIs. 45 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. 46 * Incorrect parameter types. 47 * @throws { BusinessError } 8300001 - Invalid parameter value. 48 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 49 * @throws { BusinessError } 8300003 - System internal error. 50 * @throws { BusinessError } 8300999 - Unknown error code. 51 * @syscap SystemCapability.Telephony.SmsMms 52 * @systemapi Hide this for inner system use. 53 * @since 8 54 */ 55 function splitMessage(content: string, callback: AsyncCallback<Array<string>>): void; 56 57 /** 58 * Splits a long SMS message into multiple fragments. 59 * 60 * <p>If the length of an SMS message exceeds the maximum length allowed (140 bytes), 61 * the SMS message is split into multiple segments for processing. 62 * 63 * @permission ohos.permission.SEND_MESSAGES 64 * @param { string } content - Indicates the short message content, which cannot be {@code null}. 65 * @returns { Promise<Array<string>> } Returns a list of split segments, which can be combined into a complete SMS 66 * message; Returns an empty string if no permission is granted or the short message content is {@code null}. 67 * @throws { BusinessError } 201 - Permission denied. 68 * @throws { BusinessError } 202 - Non-system applications use system APIs. 69 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. 70 * Incorrect parameter types. 71 * @throws { BusinessError } 8300001 - Invalid parameter value. 72 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 73 * @throws { BusinessError } 8300003 - System internal error. 74 * @throws { BusinessError } 8300999 - Unknown error code. 75 * @syscap SystemCapability.Telephony.SmsMms 76 * @systemapi Hide this for inner system use. 77 * @since 8 78 */ 79 function splitMessage(content: string): Promise<Array<string>>; 80 81 /** 82 * Creates an SMS message instance based on the protocol data unit (PDU) and the specified SMS protocol. 83 * 84 * <p>After receiving the original PDU data, the system creates an SMS message instance according to the specified 85 * SMS protocol. 86 * 87 * @param { Array<number> } pdu - Indicates the original data, which is obtained from the received SMS. 88 * @param { string } specification - Indicates the SMS protocol type. The value {@code 3gpp} indicates GSM/UMTS/LTE 89 * SMS, and the value {@code 3gpp2} indicates CDMA/LTE SMS. 90 * @param { AsyncCallback<ShortMessage> } callback - Indicates the callback for getting an SMS message instance; 91 * Returns {@code null} if {@code pdu} is empty or {@code specification} is not supported. 92 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. 93 * Incorrect parameter types. 94 * @throws { BusinessError } 8300001 - Invalid parameter value. 95 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 96 * @throws { BusinessError } 8300003 - System internal error. 97 * @throws { BusinessError } 8300999 - Unknown error code. 98 * @syscap SystemCapability.Telephony.SmsMms 99 * @since 6 100 */ 101 function createMessage(pdu: Array<number>, specification: string, callback: AsyncCallback<ShortMessage>): void; 102 103 /** 104 * Creates an SMS message instance based on the protocol data unit (PDU) and the specified SMS protocol. 105 * 106 * <p>After receiving the original PDU data, the system creates an SMS message instance according to the specified 107 * SMS protocol. 108 * 109 * @param { Array<number> } pdu - Indicates the original data, which is obtained from the received SMS. 110 * @param { string } specification - Indicates the SMS protocol type. The value {@code 3gpp} indicates GSM/UMTS/LTE 111 * SMS, and the value {@code 3gpp2} indicates CDMA/LTE SMS. 112 * @returns { Promise<ShortMessage> } Returns an SMS message instance; 113 * Returns {@code null} if {@code pdu} is empty or {@code specification} is not supported. 114 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. 115 * Incorrect parameter types. 116 * @throws { BusinessError } 8300001 - Invalid parameter value. 117 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 118 * @throws { BusinessError } 8300003 - System internal error. 119 * @throws { BusinessError } 8300999 - Unknown error code. 120 * @syscap SystemCapability.Telephony.SmsMms 121 * @since 6 122 */ 123 function createMessage(pdu: Array<number>, specification: string): Promise<ShortMessage>; 124 125 /** 126 * Sends a text or data SMS message. 127 * 128 * <p>This method checks whether the length of an SMS message exceeds the maximum length. If the 129 * maximum length is exceeded, the SMS message is split into multiple parts and sent separately. 130 * 131 * @permission ohos.permission.SEND_MESSAGES 132 * @param { SendMessageOptions } options - Indicates the parameters and callback for sending the SMS message. 133 * @throws { BusinessError } 201 - Permission denied. 134 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. 135 * Incorrect parameter types. 136 * @throws { BusinessError } 8300001 - Invalid parameter value. 137 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 138 * @throws { BusinessError } 8300003 - System internal error. 139 * @throws { BusinessError } 8300999 - Unknown error code. 140 * @syscap SystemCapability.Telephony.SmsMms 141 * @since 6 142 * @deprecated since 10 143 * @useinstead telephony.sms#sendShortMessage 144 */ 145 function sendMessage(options: SendMessageOptions): void; 146 147 /** 148 * Sends a text or data SMS message. 149 * 150 * <p>This method checks whether the length of an SMS message exceeds the maximum length. If the 151 * maximum length is exceeded, the SMS message is split into multiple parts and sent separately. 152 * 153 * @permission ohos.permission.SEND_MESSAGES 154 * @param { SendMessageOptions } options - Indicates the parameters and callback for sending the SMS message. 155 * @param { AsyncCallback<void> } callback - The callback of sendShortMessage. 156 * @throws { BusinessError } 201 - Permission denied. 157 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. 158 * Incorrect parameter types. 159 * @throws { BusinessError } 8300001 - Invalid parameter value. 160 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 161 * @throws { BusinessError } 8300003 - System internal error. 162 * @throws { BusinessError } 8300999 - Unknown error code. 163 * @syscap SystemCapability.Telephony.SmsMms 164 * @since 10 165 */ 166 function sendShortMessage(options: SendMessageOptions, callback: AsyncCallback<void>): void; 167 168 /** 169 * Sends a text or data SMS message. 170 * 171 * <p>This method checks whether the length of an SMS message exceeds the maximum length. If the 172 * maximum length is exceeded, the SMS message is split into multiple parts and sent separately. 173 * 174 * @permission ohos.permission.SEND_MESSAGES 175 * @param { SendMessageOptions } options - Indicates the parameters and callback for sending the SMS message. 176 * @returns { Promise<void> } The promise returned by the sendShortMessage. 177 * @throws { BusinessError } 201 - Permission denied. 178 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. 179 * Incorrect parameter types. 180 * @throws { BusinessError } 8300001 - Invalid parameter value. 181 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 182 * @throws { BusinessError } 8300003 - System internal error. 183 * @throws { BusinessError } 8300999 - Unknown error code. 184 * @syscap SystemCapability.Telephony.SmsMms 185 * @since 10 186 */ 187 function sendShortMessage(options: SendMessageOptions): Promise<void>; 188 189 /** 190 * Sets the default SIM card for sending SMS messages. You can obtain the default SIM card by 191 * using {@code getDefaultSmsSlotId}. 192 * 193 * @permission ohos.permission.SET_TELEPHONY_STATE 194 * @param { number } slotId - Indicates the default SIM card for sending SMS messages. The value {@code 0} indicates 195 * card slot 1, and the value {@code 1} indicates card slot 2. 196 * @param { AsyncCallback<void> } callback - The callback of setDefaultSmsSlotId. 197 * @throws { BusinessError } 201 - Permission denied. 198 * @throws { BusinessError } 202 - Non-system applications use system APIs. 199 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. 200 * Incorrect parameter types. 201 * @throws { BusinessError } 8300001 - Invalid parameter value. 202 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 203 * @throws { BusinessError } 8300003 - System internal error. 204 * @throws { BusinessError } 8300004 - Do not have sim card. 205 * @throws { BusinessError } 8300999 - Unknown error code. 206 * @syscap SystemCapability.Telephony.SmsMms 207 * @systemapi Hide this for inner system use. 208 * @since 7 209 */ 210 function setDefaultSmsSlotId(slotId: number, callback: AsyncCallback<void>): void; 211 212 /** 213 * Sets the default SIM card for sending SMS messages. You can obtain the default SIM card by 214 * using {@code getDefaultSmsSlotId}. 215 * 216 * @permission ohos.permission.SET_TELEPHONY_STATE 217 * @param { number } slotId - Indicates the default SIM card for sending SMS messages. The value {@code 0} indicates 218 * card slot 1, and the value {@code 1} indicates card slot 2. 219 * @returns { Promise<void> } The promise returned by the setDefaultSmsSlotId. 220 * @throws { BusinessError } 201 - Permission denied. 221 * @throws { BusinessError } 202 - Non-system applications use system APIs. 222 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. 223 * Incorrect parameter types. 224 * @throws { BusinessError } 8300001 - Invalid parameter value. 225 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 226 * @throws { BusinessError } 8300003 - System internal error. 227 * @throws { BusinessError } 8300004 - Do not have sim card. 228 * @throws { BusinessError } 8300999 - Unknown error code. 229 * @syscap SystemCapability.Telephony.SmsMms 230 * @systemapi Hide this for inner system use. 231 * @since 7 232 */ 233 function setDefaultSmsSlotId(slotId: number): Promise<void>; 234 235 /** 236 * Obtains the default SIM card for sending SMS messages. 237 * 238 * @param { AsyncCallback<number> } callback - Indicates the callback for getting the default SIM card for sending SMS 239 * messages. 240 * Returns {@code 0} if the default SIM card for sending SMS messages is in card slot 1; 241 * Returns {@code 1} if the default SIM card for sending SMS messages is in card slot 2. 242 * @syscap SystemCapability.Telephony.SmsMms 243 * @since 7 244 */ 245 function getDefaultSmsSlotId(callback: AsyncCallback<number>): void; 246 247 /** 248 * Obtains the default SIM card for sending SMS messages. 249 * 250 * @returns { Promise<number> } Returns {@code 0} if the default SIM card for sending SMS messages is in card slot 1; 251 * Returns {@code 1} if the default SIM card for sending SMS messages is in card slot 2. 252 * @syscap SystemCapability.Telephony.SmsMms 253 * @since 7 254 */ 255 function getDefaultSmsSlotId(): Promise<number>; 256 257 /** 258 * Sets the address for the Short Message Service Center (SMSC) based on a specified slot ID. 259 * 260 * @permission ohos.permission.SET_TELEPHONY_STATE 261 * @param { number } slotId - Indicates the ID of the slot holding the SIM card for sending SMS messages. 262 * @param { string } smscAddr - Indicates the SMSC address. 263 * @param { AsyncCallback<void> } callback - The callback of setSmscAddr. 264 * @throws { BusinessError } 201 - Permission denied. 265 * @throws { BusinessError } 202 - Non-system applications use system APIs. 266 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. 267 * Incorrect parameter types. 268 * @throws { BusinessError } 8300001 - Invalid parameter value. 269 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 270 * @throws { BusinessError } 8300003 - System internal error. 271 * @throws { BusinessError } 8300999 - Unknown error code. 272 * @syscap SystemCapability.Telephony.SmsMms 273 * @systemapi Hide this for inner system use. 274 * @since 7 275 */ 276 function setSmscAddr(slotId: number, smscAddr: string, callback: AsyncCallback<void>): void; 277 278 /** 279 * Sets the address for the Short Message Service Center (SMSC) based on a specified slot ID. 280 * 281 * @permission ohos.permission.SET_TELEPHONY_STATE 282 * @param { number } slotId - Indicates the ID of the slot holding the SIM card for sending SMS messages. 283 * @param { string } smscAddr - Indicates the SMSC address. 284 * @returns { Promise<void> } The promise returned by the setSmscAddr. 285 * @throws { BusinessError } 201 - Permission denied. 286 * @throws { BusinessError } 202 - Non-system applications use system APIs. 287 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. 288 * Incorrect parameter types. 289 * @throws { BusinessError } 8300001 - Invalid parameter value. 290 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 291 * @throws { BusinessError } 8300003 - System internal error. 292 * @throws { BusinessError } 8300999 - Unknown error code. 293 * @syscap SystemCapability.Telephony.SmsMms 294 * @systemapi Hide this for inner system use. 295 * @since 7 296 */ 297 function setSmscAddr(slotId: number, smscAddr: string): Promise<void>; 298 299 /** 300 * Obtains the SMSC address based on a specified slot ID. 301 * 302 * @permission ohos.permission.GET_TELEPHONY_STATE 303 * @param { number } slotId - Indicates the ID of the slot holding the SIM card for sending SMS messages. 304 * @param { AsyncCallback<string> } callback - Indicates the callback for getting the SMSC address. 305 * @throws { BusinessError } 201 - Permission denied. 306 * @throws { BusinessError } 202 - Non-system applications use system APIs. 307 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. 308 * Incorrect parameter types. 309 * @throws { BusinessError } 8300001 - Invalid parameter value. 310 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 311 * @throws { BusinessError } 8300003 - System internal error. 312 * @throws { BusinessError } 8300999 - Unknown error code. 313 * @syscap SystemCapability.Telephony.SmsMms 314 * @systemapi Hide this for inner system use. 315 * @since 7 316 */ 317 function getSmscAddr(slotId: number, callback: AsyncCallback<string>): void; 318 319 /** 320 * Obtains the SMSC address based on a specified slot ID. 321 * 322 * @permission ohos.permission.GET_TELEPHONY_STATE 323 * @param { number } slotId - Indicates the ID of the slot holding the SIM card for sending SMS messages. 324 * @returns { Promise<string> } Returns the SMSC address. 325 * @throws { BusinessError } 201 - Permission denied. 326 * @throws { BusinessError } 202 - Non-system applications use system APIs. 327 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. 328 * Incorrect parameter types. 329 * @throws { BusinessError } 8300001 - Invalid parameter value. 330 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 331 * @throws { BusinessError } 8300003 - System internal error. 332 * @throws { BusinessError } 8300999 - Unknown error code. 333 * @syscap SystemCapability.Telephony.SmsMms 334 * @systemapi Hide this for inner system use. 335 * @since 7 336 */ 337 function getSmscAddr(slotId: number): Promise<string>; 338 339 /** 340 * Returns whether a device is capable of sending and receiving SMS messages. 341 * 342 * @returns { boolean } Returns {@code true} if the device is capable of sending and receiving SMS messages; 343 * Returns {@code false} otherwise. 344 * @syscap SystemCapability.Telephony.SmsMms 345 * @since 7 346 */ 347 function hasSmsCapability(): boolean; 348 349 /** 350 * Add an SMS Message to SIM card. 351 * 352 * @permission ohos.permission.RECEIVE_SMS and ohos.permission.SEND_MESSAGES 353 * @param { SimMessageOptions } options - Indicates SIM message options. 354 * @param { AsyncCallback<void> } callback - The callback of addSimMessage. 355 * @throws { BusinessError } 201 - Permission denied. 356 * @throws { BusinessError } 202 - Non-system applications use system APIs. 357 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. 358 * Incorrect parameter types. 3. Parameter verification failed. 359 * @throws { BusinessError } 8300001 - Invalid parameter value. 360 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 361 * @throws { BusinessError } 8300003 - System internal error. 362 * @throws { BusinessError } 8300999 - Unknown error code. 363 * @syscap SystemCapability.Telephony.SmsMms 364 * @systemapi Hide this for inner system use. 365 * @since 7 366 */ 367 function addSimMessage(options: SimMessageOptions, callback: AsyncCallback<void>): void; 368 369 /** 370 * Add an SMS Message to SIM card. 371 * 372 * @permission ohos.permission.RECEIVE_SMS and ohos.permission.SEND_MESSAGES 373 * @param { SimMessageOptions } options - Indicates SIM message options. 374 * @returns { Promise<void> } The promise returned by the addSimMessage. 375 * @throws { BusinessError } 201 - Permission denied. 376 * @throws { BusinessError } 202 - Non-system applications use system APIs. 377 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. 378 * Incorrect parameter types. 3. Parameter verification failed. 379 * @throws { BusinessError } 8300001 - Invalid parameter value. 380 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 381 * @throws { BusinessError } 8300003 - System internal error. 382 * @throws { BusinessError } 8300999 - Unknown error code. 383 * @syscap SystemCapability.Telephony.SmsMms 384 * @systemapi Hide this for inner system use. 385 * @since 7 386 */ 387 function addSimMessage(options: SimMessageOptions): Promise<void>; 388 389 /** 390 * Delete an SMS Message from the SIM card. 391 * 392 * @permission ohos.permission.RECEIVE_SMS and ohos.permission.SEND_MESSAGES 393 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot index 394 * number supported by the device. 395 * @param { number } msgIndex - Indicates the message index. 396 * @param { AsyncCallback<void> } callback - The callback of delSimMessage. 397 * @throws { BusinessError } 201 - Permission denied. 398 * @throws { BusinessError } 202 - Non-system applications use system APIs. 399 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. 400 * Incorrect parameter types. 401 * @throws { BusinessError } 8300001 - Invalid parameter value. 402 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 403 * @throws { BusinessError } 8300003 - System internal error. 404 * @throws { BusinessError } 8300999 - Unknown error code. 405 * @syscap SystemCapability.Telephony.SmsMms 406 * @systemapi Hide this for inner system use. 407 * @since 7 408 */ 409 function delSimMessage(slotId: number, msgIndex: number, callback: AsyncCallback<void>): void; 410 411 /** 412 * Delete an SMS Message from the SIM card. 413 * 414 * @permission ohos.permission.RECEIVE_SMS and ohos.permission.SEND_MESSAGES 415 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot index 416 * number supported by the device. 417 * @param { number } msgIndex - Indicates the message index. 418 * @returns { Promise<void> } The promise returned by the delSimMessage. 419 * @throws { BusinessError } 201 - Permission denied. 420 * @throws { BusinessError } 202 - Non-system applications use system APIs. 421 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. 422 * Incorrect parameter types. 423 * @throws { BusinessError } 8300001 - Invalid parameter value. 424 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 425 * @throws { BusinessError } 8300003 - System internal error. 426 * @throws { BusinessError } 8300999 - Unknown error code. 427 * @syscap SystemCapability.Telephony.SmsMms 428 * @systemapi Hide this for inner system use. 429 * @since 7 430 */ 431 function delSimMessage(slotId: number, msgIndex: number): Promise<void>; 432 433 /** 434 * Update a SIM SMS of SIM card. 435 * 436 * @permission ohos.permission.RECEIVE_SMS and ohos.permission.SEND_MESSAGES 437 * @param { UpdateSimMessageOptions } options - Indicates update SIM message options. 438 * @param { AsyncCallback<void> } callback - The callback of updateSimMessage. 439 * @throws { BusinessError } 201 - Permission denied. 440 * @throws { BusinessError } 202 - Non-system applications use system APIs. 441 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. 442 * Incorrect parameter types. 3. Parameter verification failed. 443 * @throws { BusinessError } 8300001 - Invalid parameter value. 444 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 445 * @throws { BusinessError } 8300003 - System internal error. 446 * @throws { BusinessError } 8300999 - Unknown error code. 447 * @syscap SystemCapability.Telephony.SmsMms 448 * @systemapi Hide this for inner system use. 449 * @since 7 450 */ 451 function updateSimMessage(options: UpdateSimMessageOptions, callback: AsyncCallback<void>): void; 452 453 /** 454 * Update a SIM SMS of SIM card. 455 * 456 * @permission ohos.permission.RECEIVE_SMS and ohos.permission.SEND_MESSAGES 457 * @param { UpdateSimMessageOptions } options - Indicates update SIM message options. 458 * @returns { Promise<void> } The promise returned by the updateSimMessage. 459 * @throws { BusinessError } 201 - Permission denied. 460 * @throws { BusinessError } 202 - Non-system applications use system APIs. 461 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. 462 * Incorrect parameter types. 3. Parameter verification failed. 463 * @throws { BusinessError } 8300001 - Invalid parameter value. 464 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 465 * @throws { BusinessError } 8300003 - System internal error. 466 * @throws { BusinessError } 8300999 - Unknown error code. 467 * @syscap SystemCapability.Telephony.SmsMms 468 * @systemapi Hide this for inner system use. 469 * @since 7 470 */ 471 function updateSimMessage(options: UpdateSimMessageOptions): Promise<void>; 472 473 /** 474 * Get all SMS records in SIM. 475 * 476 * @permission ohos.permission.RECEIVE_SMS 477 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot index 478 * number supported by the device. 479 * @param { AsyncCallback<Array<SimShortMessage>> } callback - Indicates the callback for getting a 480 * {@code SimShortMessage} object. 481 * @throws { BusinessError } 201 - Permission denied. 482 * @throws { BusinessError } 202 - Non-system applications use system APIs. 483 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. 484 * Incorrect parameter types. 485 * @throws { BusinessError } 8300001 - Invalid parameter value. 486 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 487 * @throws { BusinessError } 8300003 - System internal error. 488 * @throws { BusinessError } 8300999 - Unknown error code. 489 * @syscap SystemCapability.Telephony.SmsMms 490 * @systemapi Hide this for inner system use. 491 * @since 7 492 */ 493 function getAllSimMessages(slotId: number, callback: AsyncCallback<Array<SimShortMessage>>): void; 494 495 /** 496 * Get all SMS records in SIM. 497 * 498 * @permission ohos.permission.RECEIVE_SMS 499 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot index 500 * number supported by the device. 501 * @returns { Promise<Array<SimShortMessage>> } Returns a {@code SimShortMessage} object. 502 * @throws { BusinessError } 201 - Permission denied. 503 * @throws { BusinessError } 202 - Non-system applications use system APIs. 504 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. 505 * Incorrect parameter types. 506 * @throws { BusinessError } 8300001 - Invalid parameter value. 507 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 508 * @throws { BusinessError } 8300003 - System internal error. 509 * @throws { BusinessError } 8300999 - Unknown error code. 510 * @syscap SystemCapability.Telephony.SmsMms 511 * @systemapi Hide this for inner system use. 512 * @since 7 513 */ 514 function getAllSimMessages(slotId: number): Promise<Array<SimShortMessage>>; 515 516 /** 517 * Turn on or off Cell BroadCast. 518 * 519 * @permission ohos.permission.RECEIVE_SMS 520 * @param { CBConfigOptions } options - Indicates cell broadcast configuration options. 521 * @param { AsyncCallback<void> } callback - The callback of setCBConfig. 522 * @throws { BusinessError } 201 - Permission denied. 523 * @throws { BusinessError } 202 - Non-system applications use system APIs. 524 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. 525 * Incorrect parameter types. 526 * @throws { BusinessError } 8300001 - Invalid parameter value. 527 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 528 * @throws { BusinessError } 8300003 - System internal error. 529 * @throws { BusinessError } 8300999 - Unknown error code. 530 * @syscap SystemCapability.Telephony.SmsMms 531 * @systemapi Hide this for inner system use. 532 * @since 7 533 */ 534 function setCBConfig(options: CBConfigOptions, callback: AsyncCallback<void>): void; 535 536 /** 537 * Turn on or off Cell BroadCast. 538 * 539 * @permission ohos.permission.RECEIVE_SMS 540 * @param { CBConfigOptions } options - Indicates cell broadcast configuration options. 541 * @returns { Promise<void> } The promise returned by the setCBConfig. 542 * @throws { BusinessError } 201 - Permission denied. 543 * @throws { BusinessError } 202 - Non-system applications use system APIs. 544 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. 545 * Incorrect parameter types. 546 * @throws { BusinessError } 8300001 - Invalid parameter value. 547 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 548 * @throws { BusinessError } 8300003 - System internal error. 549 * @throws { BusinessError } 8300999 - Unknown error code. 550 * @syscap SystemCapability.Telephony.SmsMms 551 * @systemapi Hide this for inner system use. 552 * @since 7 553 */ 554 function setCBConfig(options: CBConfigOptions): Promise<void>; 555 556 /** 557 * Turn on Cell BroadCast by list. 558 * 559 * @permission ohos.permission.RECEIVE_SMS 560 * @param { CBConfigListOptions } options - Indicates cell broadcast configuration list options. 561 * @param { AsyncCallback<void> } callback - The callback of setCBConfigList. 562 * @throws { BusinessError } 201 - Permission denied. 563 * @throws { BusinessError } 202 - Non-system applications use system APIs. 564 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. 565 * Incorrect parameter types. 566 * @throws { BusinessError } 8300001 - Invalid parameter value. 567 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 568 * @throws { BusinessError } 8300003 - System internal error. 569 * @throws { BusinessError } 8300999 - Unknown error code. 570 * @syscap SystemCapability.Telephony.SmsMms 571 * @systemapi Hide this for inner system use. 572 * @since 7 573 */ 574 function setCBConfigList(options: CBConfigListOptions, callback: AsyncCallback<void>): void; 575 576 /** 577 * Turn on Cell BroadCast by list. 578 * 579 * @permission ohos.permission.RECEIVE_SMS 580 * @param { CBConfigListOptions } options - Indicates cell broadcast configuration list options. 581 * @returns { Promise<void> } The promise returned by the setCBConfigList. 582 * @throws { BusinessError } 201 - Permission denied. 583 * @throws { BusinessError } 202 - Non-system applications use system APIs. 584 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. 585 * Incorrect parameter types. 586 * @throws { BusinessError } 8300001 - Invalid parameter value. 587 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 588 * @throws { BusinessError } 8300003 - System internal error. 589 * @throws { BusinessError } 8300999 - Unknown error code. 590 * @syscap SystemCapability.Telephony.SmsMms 591 * @systemapi Hide this for inner system use. 592 * @since 7 593 */ 594 function setCBConfigList(options: CBConfigListOptions): Promise<void>; 595 596 /** 597 * Get an SMS segment encode relation information. 598 * 599 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot index 600 * number supported by the device. 601 * @param { string } message - Indicates short message. 602 * @param { boolean } force7bit - Indicates whether to use 7 bit encoding. 603 * @param { AsyncCallback<SmsSegmentsInfo> } callback - Indicates the callback for getting a {@code SmsSegmentsInfo} 604 * object. 605 * @throws { BusinessError } 202 - Non-system applications use system APIs. 606 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. 607 * Incorrect parameter types. 3. Parameter verification failed. 608 * @throws { BusinessError } 8300001 - Invalid parameter value. 609 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 610 * @throws { BusinessError } 8300003 - System internal error. 611 * @throws { BusinessError } 8300999 - Unknown error code. 612 * @syscap SystemCapability.Telephony.SmsMms 613 * @systemapi Hide this for inner system use. 614 * @since 8 615 */ 616 function getSmsSegmentsInfo(slotId: number, message: string, force7bit: boolean, callback: AsyncCallback<SmsSegmentsInfo>): void; 617 618 /** 619 * Get an SMS segment encode relation information. 620 * 621 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot index 622 * number supported by the device. 623 * @param { string } message - Indicates short message. 624 * @param { boolean } force7bit - Indicates whether to use 7 bit encoding. 625 * @returns { Promise<SmsSegmentsInfo> } Returns a {@code SmsSegmentsInfo} object. 626 * @throws { BusinessError } 202 - Non-system applications use system APIs. 627 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. 628 * Incorrect parameter types. 3. Parameter verification failed. 629 * @throws { BusinessError } 8300001 - Invalid parameter value. 630 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 631 * @throws { BusinessError } 8300003 - System internal error. 632 * @throws { BusinessError } 8300999 - Unknown error code. 633 * @syscap SystemCapability.Telephony.SmsMms 634 * @systemapi Hide this for inner system use. 635 * @since 8 636 */ 637 function getSmsSegmentsInfo(slotId: number, message: string, force7bit: boolean): Promise<SmsSegmentsInfo>; 638 639 /** 640 * SMS over IMS is supported if IMS is registered and SMS is supported on IMS. 641 * 642 * @param { number } slotId - Indicates the default SIM card for Ims Sms. The value {@code 0} indicates card slot 1, 643 * and the value {@code 1} indicates card slot 2. 644 * @param { AsyncCallback<boolean> } callback - Indicates the callback of isImsSmsSupported. 645 * Returns {@code true} if SMS over IMS is supported, {@code false} otherwise. 646 * @throws { BusinessError } 202 - Non-system applications use system APIs. 647 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. 648 * Incorrect parameter types. 649 * @throws { BusinessError } 8300001 - Invalid parameter value. 650 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 651 * @throws { BusinessError } 8300003 - System internal error. 652 * @throws { BusinessError } 8300999 - Unknown error code. 653 * @syscap SystemCapability.Telephony.SmsMms 654 * @systemapi Hide this for inner system use. 655 * @since 8 656 */ 657 function isImsSmsSupported(slotId: number, callback: AsyncCallback<boolean>): void; 658 659 /** 660 * SMS over IMS is supported if IMS is registered and SMS is supported on IMS. 661 * 662 * @param { number } slotId - Indicates the default SIM card for Ims Sms. The value {@code 0} indicates card slot 1, 663 * and the value {@code 1} indicates card slot 2. 664 * @returns { Promise<boolean> } Returns {@code true} if SMS over IMS is supported, {@code false} otherwise. 665 * @throws { BusinessError } 202 - Non-system applications use system APIs. 666 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. 667 * Incorrect parameter types. 668 * @throws { BusinessError } 8300001 - Invalid parameter value. 669 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 670 * @throws { BusinessError } 8300003 - System internal error. 671 * @throws { BusinessError } 8300999 - Unknown error code. 672 * @syscap SystemCapability.Telephony.SmsMms 673 * @systemapi Hide this for inner system use. 674 * @since 8 675 */ 676 function isImsSmsSupported(slotId: number): Promise<boolean>; 677 678 /** 679 * Gets SMS format supported on IMS. SMS over IMS format is either 3GPP or 3GPP2. 680 * 681 * @param { AsyncCallback<string> } callback - Indicates the callback for getting format, 3gpp, 3gpp2 or unknown. 682 * @throws { BusinessError } 202 - Non-system applications use system APIs. 683 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. 684 * Incorrect parameter types. 685 * @throws { BusinessError } 8300001 - Invalid parameter value. 686 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 687 * @throws { BusinessError } 8300003 - System internal error. 688 * @throws { BusinessError } 8300999 - Unknown error code. 689 * @syscap SystemCapability.Telephony.SmsMms 690 * @systemapi Hide this for inner system use. 691 * @since 8 692 */ 693 function getImsShortMessageFormat(callback: AsyncCallback<string>): void; 694 695 /** 696 * Gets SMS format supported on IMS. SMS over IMS format is either 3GPP or 3GPP2. 697 * 698 * @returns { Promise<string> } Returns format, 3gpp, 3gpp2 or unknown. 699 * @throws { BusinessError } 202 - Non-system applications use system APIs. 700 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 701 * @throws { BusinessError } 8300003 - System internal error. 702 * @throws { BusinessError } 8300999 - Unknown error code. 703 * @syscap SystemCapability.Telephony.SmsMms 704 * @systemapi Hide this for inner system use. 705 * @since 8 706 */ 707 function getImsShortMessageFormat(): Promise<string>; 708 709 /** 710 * Decode the message content. 711 * 712 * @param { string | Array<number> } mmsFilePathName - Indicates the path name of the multimedia message file. 713 * @param { AsyncCallback<MmsInformation> } callback - Indicates the callback for getting a {@code MmsInformation} 714 * object. 715 * @throws { BusinessError } 202 - Non-system applications use system APIs. 716 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. 717 * Incorrect parameter types. 3. Parameter verification failed. 718 * @throws { BusinessError } 8300001 - Invalid parameter value. 719 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 720 * @throws { BusinessError } 8300003 - System internal error. 721 * @throws { BusinessError } 8300999 - Unknown error code. 722 * @syscap SystemCapability.Telephony.SmsMms 723 * @systemapi Hide this for inner system use. 724 * @since 8 725 */ 726 function decodeMms(mmsFilePathName: string | Array<number>, callback: AsyncCallback<MmsInformation>): void; 727 728 /** 729 * Decode the message content. 730 * 731 * @param { string | Array<number> } mmsFilePathName - Indicates the path name of the multimedia message file. 732 * @returns { Promise<MmsInformation> } Returns a {@code MmsInformation} object. 733 * @throws { BusinessError } 202 - Non-system applications use system APIs. 734 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. 735 * Incorrect parameter types. 3. Parameter verification failed. 736 * @throws { BusinessError } 8300001 - Invalid parameter value. 737 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 738 * @throws { BusinessError } 8300003 - System internal error. 739 * @throws { BusinessError } 8300999 - Unknown error code. 740 * @syscap SystemCapability.Telephony.SmsMms 741 * @systemapi Hide this for inner system use. 742 * @since 8 743 */ 744 function decodeMms(mmsFilePathName: string | Array<number>): Promise<MmsInformation>; 745 746 /** 747 * Encode the message content. 748 * 749 * @param { MmsInformation } mms - Indicates MMS messages. 750 * @param { AsyncCallback<Array<number>> } callback - Indicates the callback for getting the result of MMS encoding. 751 * @throws { BusinessError } 202 - Non-system applications use system APIs. 752 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. 753 * Incorrect parameter types. 3. Parameter verification failed. 754 * @throws { BusinessError } 8300001 - Invalid parameter value. 755 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 756 * @throws { BusinessError } 8300003 - System internal error. 757 * @throws { BusinessError } 8300999 - Unknown error code. 758 * @syscap SystemCapability.Telephony.SmsMms 759 * @systemapi Hide this for inner system use. 760 * @since 8 761 */ 762 function encodeMms(mms: MmsInformation, callback: AsyncCallback<Array<number>>): void; 763 764 /** 765 * Encode the message content. 766 * 767 * @param { MmsInformation } mms - Indicates MMS messages. 768 * @returns { Promise<Array<number>> } Returns the result of MMS encoding. 769 * @throws { BusinessError } 202 - Non-system applications use system APIs. 770 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. 771 * Incorrect parameter types. 3. Parameter verification failed. 772 * @throws { BusinessError } 8300001 - Invalid parameter value. 773 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 774 * @throws { BusinessError } 8300003 - System internal error. 775 * @throws { BusinessError } 8300999 - Unknown error code. 776 * @syscap SystemCapability.Telephony.SmsMms 777 * @systemapi Hide this for inner system use. 778 * @since 8 779 */ 780 function encodeMms(mms: MmsInformation): Promise<Array<number>>; 781 782 /** 783 * Obtains the default SIM ID for sending SMS messages. 784 * 785 * @param { AsyncCallback<number> } callback - Returns the SIM ID of the default sms sim and 786 * SIM ID will increase from 1. 787 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. 788 * Incorrect parameter types. 789 * @throws { BusinessError } 8300001 - Invalid parameter value. 790 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 791 * @throws { BusinessError } 8300003 - System internal error. 792 * @throws { BusinessError } 8300004 - Do not have sim card. 793 * @throws { BusinessError } 8300999 - Unknown error code. 794 * @throws { BusinessError } 8301001 - SIM card is not activated. 795 * @syscap SystemCapability.Telephony.SmsMms 796 * @since 10 797 */ 798 function getDefaultSmsSimId(callback: AsyncCallback<number>): void; 799 800 /** 801 * Obtains the default SIM ID for sending SMS messages. 802 * 803 * @returns { Promise<number> } Returns the SIM ID of the default sms sim and 804 * SIM ID will increase from 1. 805 * @throws { BusinessError } 8300001 - Invalid parameter value. 806 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 807 * @throws { BusinessError } 8300003 - System internal error. 808 * @throws { BusinessError } 8300004 - Do not have sim card. 809 * @throws { BusinessError } 8300999 - Unknown error code. 810 * @throws { BusinessError } 8301001 - SIM card is not activated. 811 * @syscap SystemCapability.Telephony.SmsMms 812 * @since 10 813 */ 814 function getDefaultSmsSimId(): Promise<number>; 815 816 /** 817 * Defines the MMS message information. 818 * 819 * @interface MmsInformation 820 * @syscap SystemCapability.Telephony.SmsMms 821 * @systemapi Hide this for inner system use. 822 * @since 8 823 */ 824 export interface MmsInformation { 825 /** 826 * Indicates the message type for the MMS message. 827 * 828 * @type { MessageType } 829 * @syscap SystemCapability.Telephony.SmsMms 830 * @systemapi Hide this for inner system use. 831 * @since 8 832 */ 833 messageType: MessageType; 834 835 /** 836 * Indicates the PDU header type for the MMS message. 837 * 838 * @type { MmsSendReq | MmsSendConf | MmsNotificationInd | MmsRespInd | MmsRetrieveConf | MmsAcknowledgeInd | 839 * MmsDeliveryInd | MmsReadOrigInd | MmsReadRecInd } 840 * @syscap SystemCapability.Telephony.SmsMms 841 * @systemapi Hide this for inner system use. 842 * @since 8 843 */ 844 mmsType: MmsSendReq | MmsSendConf | MmsNotificationInd | MmsRespInd | MmsRetrieveConf | MmsAcknowledgeInd | MmsDeliveryInd | MmsReadOrigInd | MmsReadRecInd; 845 846 /** 847 * Indicates the attachment for the MMS message. 848 * 849 * @type { ?Array<MmsAttachment> } 850 * @syscap SystemCapability.Telephony.SmsMms 851 * @systemapi Hide this for inner system use. 852 * @since 8 853 */ 854 attachment?: Array<MmsAttachment>; 855 } 856 857 /** 858 * Sends an MMS message. 859 * 860 * @permission ohos.permission.SEND_MESSAGES 861 * @param { Context } context - Indicates the context of application or capability. 862 * @param { MmsParams } mmsParams - Indicates the parameters of the MMS message. 863 * @param { AsyncCallback<void> } callback - The callback of sendMms. For error code, see MmsFailCode. 864 * @throws { BusinessError } 201 - Permission denied. 865 * @throws { BusinessError } 202 - Non-system applications use system APIs. 866 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. 867 * Incorrect parameter types. 3. Parameter verification failed. 868 * @throws { BusinessError } 8300001 - Invalid parameter value. 869 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 870 * @throws { BusinessError } 8300003 - System internal error. 871 * @throws { BusinessError } 8300999 - Unknown error code. 872 * @syscap SystemCapability.Telephony.SmsMms 873 * @systemapi Hide this for inner system use. 874 * @since 11 875 */ 876 function sendMms(context: Context, mmsParams: MmsParams, callback: AsyncCallback<void>): void; 877 878 /** 879 * Sends an MMS message. 880 * 881 * @permission ohos.permission.SEND_MESSAGES 882 * @param { Context } context - Indicates the context of application or capability. 883 * @param { MmsParams } mmsParams - Indicates the parameters of the MMS message. 884 * @returns { Promise<void> } The promise returned by the sendMms. 885 * @throws { BusinessError } 201 - Permission denied. 886 * @throws { BusinessError } 202 - Non-system applications use system APIs. 887 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. 888 * Incorrect parameter types. 3. Parameter verification failed. 889 * @throws { BusinessError } 8300001 - Invalid parameter value. 890 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 891 * @throws { BusinessError } 8300003 - System internal error. 892 * @throws { BusinessError } 8300999 - Unknown error code. 893 * @syscap SystemCapability.Telephony.SmsMms 894 * @systemapi Hide this for inner system use. 895 * @since 11 896 */ 897 function sendMms(context: Context, mmsParams: MmsParams): Promise<void>; 898 899 /** 900 * Downloads an MMS message. 901 * 902 * @permission ohos.permission.RECEIVE_MMS 903 * @param { Context } context - Indicates the context of application or capability. 904 * @param { MmsParams } mmsParams - Indicates the parameters of the MMS message. 905 * @param { AsyncCallback<void> } callback - The callback of downloadMms. For error code, see MmsFailCode. 906 * @throws { BusinessError } 201 - Permission denied. 907 * @throws { BusinessError } 202 - Non-system applications use system APIs. 908 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. 909 * Incorrect parameter types. 910 * @throws { BusinessError } 8300001 - Invalid parameter value. 911 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 912 * @throws { BusinessError } 8300003 - System internal error. 913 * @throws { BusinessError } 8300999 - Unknown error code. 914 * @syscap SystemCapability.Telephony.SmsMms 915 * @systemapi Hide this for inner system use. 916 * @since 11 917 */ 918 function downloadMms(context: Context, mmsParams: MmsParams, callback: AsyncCallback<void>): void; 919 920 /** 921 * Downloads an MMS message. 922 * 923 * @permission ohos.permission.RECEIVE_MMS 924 * @param { Context } context - Indicates the context of application or capability. 925 * @param { MmsParams } mmsParams - Indicates the parameters of the MMS message. 926 * @returns { Promise<void> } The promise returned by the downloadMms. For error code, see MmsFailCode. 927 * @throws { BusinessError } 201 - Permission denied. 928 * @throws { BusinessError } 202 - Non-system applications use system APIs. 929 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. 930 * Incorrect parameter types. 931 * @throws { BusinessError } 8300001 - Invalid parameter value. 932 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 933 * @throws { BusinessError } 8300003 - System internal error. 934 * @throws { BusinessError } 8300999 - Unknown error code. 935 * @syscap SystemCapability.Telephony.SmsMms 936 * @systemapi Hide this for inner system use. 937 * @since 11 938 */ 939 function downloadMms(context: Context, mmsParams: MmsParams): Promise<void>; 940 941 /** 942 * Defines the MMS message param. 943 * 944 * @interface MmsParams 945 * @syscap SystemCapability.Telephony.SmsMms 946 * @systemapi Hide this for inner system use. 947 * @since 11 948 */ 949 export interface MmsParams { 950 /** 951 * Indicates the ID of the SIM card slot used for sending the MMS message. 952 * 953 * @type { number } 954 * @syscap SystemCapability.Telephony.SmsMms 955 * @systemapi Hide this for inner system use. 956 * @since 11 957 */ 958 slotId: number; 959 960 /** 961 * Indicates the MMSC used for sending the MMS message. 962 * 963 * @type { string } 964 * @syscap SystemCapability.Telephony.SmsMms 965 * @systemapi Hide this for inner system use. 966 * @since 11 967 */ 968 mmsc: string; 969 970 /** 971 * Indicates the MMS pdu url used for sending the MMS message. 972 * 973 * @type { string } 974 * @syscap SystemCapability.Telephony.SmsMms 975 * @systemapi Hide this for inner system use. 976 * @since 11 977 */ 978 data: string; 979 980 /** 981 * Indicates the MMS UA and MMS UaProf used for sending the MMS message. 982 * 983 * @type { ?MmsConfig } 984 * @syscap SystemCapability.Telephony.SmsMms 985 * @systemapi Hide this for inner system use. 986 * @since 11 987 */ 988 mmsConfig?: MmsConfig; 989 } 990 991 /** 992 * Defines the MMS message config. 993 * 994 * @interface MmsConfig 995 * @syscap SystemCapability.Telephony.SmsMms 996 * @systemapi Hide this for inner system use. 997 * @since 11 998 */ 999 export interface MmsConfig { 1000 /** 1001 * Indicates the user agent used for the MMS message. 1002 * 1003 * @type { string } 1004 * @syscap SystemCapability.Telephony.SmsMms 1005 * @systemapi Hide this for inner system use. 1006 * @since 11 1007 */ 1008 userAgent: string; 1009 1010 /** 1011 * Indicates the user agent profile for the MMS message. 1012 * 1013 * @type { string } 1014 * @syscap SystemCapability.Telephony.SmsMms 1015 * @systemapi Hide this for inner system use. 1016 * @since 11 1017 */ 1018 userAgentProfile: string; 1019 } 1020 1021 /** 1022 * Defines an MMS message sending request. 1023 * 1024 * @interface MmsSendReq 1025 * @syscap SystemCapability.Telephony.SmsMms 1026 * @systemapi Hide this for inner system use. 1027 * @since 8 1028 */ 1029 export interface MmsSendReq { 1030 /** 1031 * Indicates the source address for the MMS message sending request. 1032 * 1033 * @type { MmsAddress } 1034 * @syscap SystemCapability.Telephony.SmsMms 1035 * @systemapi Hide this for inner system use. 1036 * @since 8 1037 */ 1038 from: MmsAddress; 1039 1040 /** 1041 * Indicates the transaction ID for the MMS message sending request. 1042 * 1043 * @type { string } 1044 * @syscap SystemCapability.Telephony.SmsMms 1045 * @systemapi Hide this for inner system use. 1046 * @since 8 1047 */ 1048 transactionId: string; 1049 1050 /** 1051 * Indicates the content type for the MMS message sending request. 1052 * 1053 * @type { string } 1054 * @syscap SystemCapability.Telephony.SmsMms 1055 * @systemapi Hide this for inner system use. 1056 * @since 8 1057 */ 1058 contentType: string; 1059 1060 /** 1061 * Indicates the version for the MMS message sending request. 1062 * 1063 * @type { MmsVersionType } 1064 * @syscap SystemCapability.Telephony.SmsMms 1065 * @systemapi Hide this for inner system use. 1066 * @since 8 1067 */ 1068 version: MmsVersionType; 1069 1070 /** 1071 * Indicates the destination address for the MMS message sending request. 1072 * 1073 * @type { ?Array<MmsAddress> } 1074 * @syscap SystemCapability.Telephony.SmsMms 1075 * @systemapi Hide this for inner system use. 1076 * @since 8 1077 */ 1078 to?: Array<MmsAddress>; 1079 1080 /** 1081 * Indicates the date for the MMS message sending request. 1082 * 1083 * @type { ?number } 1084 * @syscap SystemCapability.Telephony.SmsMms 1085 * @systemapi Hide this for inner system use. 1086 * @since 8 1087 */ 1088 date?: number; 1089 1090 /** 1091 * Indicates the carbon copy address for the MMS message sending request. 1092 * 1093 * @type { ?Array<MmsAddress> } 1094 * @syscap SystemCapability.Telephony.SmsMms 1095 * @systemapi Hide this for inner system use. 1096 * @since 8 1097 */ 1098 cc?: Array<MmsAddress>; 1099 1100 /** 1101 * Indicates the blind carbon copy address for the MMS message sending request. 1102 * 1103 * @type { ?Array<MmsAddress> } 1104 * @syscap SystemCapability.Telephony.SmsMms 1105 * @systemapi Hide this for inner system use. 1106 * @since 8 1107 */ 1108 bcc?: Array<MmsAddress>; 1109 1110 /** 1111 * Indicates the subject for the MMS message sending request. 1112 * 1113 * @type { ?string } 1114 * @syscap SystemCapability.Telephony.SmsMms 1115 * @systemapi Hide this for inner system use. 1116 * @since 8 1117 */ 1118 subject?: string; 1119 1120 /** 1121 * Indicates the message class for the MMS message sending request. 1122 * 1123 * @type { ?number } 1124 * @syscap SystemCapability.Telephony.SmsMms 1125 * @systemapi Hide this for inner system use. 1126 * @since 8 1127 */ 1128 messageClass?: number; 1129 1130 /** 1131 * Indicates the expiration for the MMS message sending request. 1132 * 1133 * @type { ?number } 1134 * @syscap SystemCapability.Telephony.SmsMms 1135 * @systemapi Hide this for inner system use. 1136 * @since 8 1137 */ 1138 expiry?: number; 1139 1140 /** 1141 * Indicates the priority for the MMS message sending request. 1142 * 1143 * @type { ?MmsPriorityType } 1144 * @syscap SystemCapability.Telephony.SmsMms 1145 * @systemapi Hide this for inner system use. 1146 * @since 8 1147 */ 1148 priority?: MmsPriorityType; 1149 1150 /** 1151 * Indicates the sender visibility for the MMS message sending request. 1152 * 1153 * @type { ?number } 1154 * @syscap SystemCapability.Telephony.SmsMms 1155 * @systemapi Hide this for inner system use. 1156 * @since 8 1157 */ 1158 senderVisibility?: number; 1159 1160 /** 1161 * Indicates the delivery report for the MMS message sending request. 1162 * 1163 * @type { ?number } 1164 * @syscap SystemCapability.Telephony.SmsMms 1165 * @systemapi Hide this for inner system use. 1166 * @since 8 1167 */ 1168 deliveryReport?: number; 1169 1170 /** 1171 * Indicates the read report for the MMS message sending request. 1172 * 1173 * @type { ?number } 1174 * @syscap SystemCapability.Telephony.SmsMms 1175 * @systemapi Hide this for inner system use. 1176 * @since 8 1177 */ 1178 readReport?: number; 1179 } 1180 1181 /** 1182 * Defines the MMS message sending configuration. 1183 * 1184 * @interface MmsSendConf 1185 * @syscap SystemCapability.Telephony.SmsMms 1186 * @systemapi Hide this for inner system use. 1187 * @since 8 1188 */ 1189 export interface MmsSendConf { 1190 /** 1191 * Indicates the response status for the MMS message sending configuration. 1192 * 1193 * @type { number } 1194 * @syscap SystemCapability.Telephony.SmsMms 1195 * @systemapi Hide this for inner system use. 1196 * @since 8 1197 */ 1198 responseState: number; 1199 1200 /** 1201 * Indicates the transaction ID for the MMS message sending configuration. 1202 * 1203 * @type { string } 1204 * @syscap SystemCapability.Telephony.SmsMms 1205 * @systemapi Hide this for inner system use. 1206 * @since 8 1207 */ 1208 transactionId: string; 1209 1210 /** 1211 * Indicates the version for the MMS message sending configuration. 1212 * 1213 * @type { MmsVersionType } 1214 * @syscap SystemCapability.Telephony.SmsMms 1215 * @systemapi Hide this for inner system use. 1216 * @since 8 1217 */ 1218 version: MmsVersionType; 1219 1220 /** 1221 * Indicates the message ID for the MMS message sending configuration. 1222 * 1223 * @type { ?string } 1224 * @syscap SystemCapability.Telephony.SmsMms 1225 * @systemapi Hide this for inner system use. 1226 * @since 8 1227 */ 1228 messageId?: string; 1229 } 1230 1231 /** 1232 * Defines an MMS notification indication. 1233 * 1234 * @interface MmsNotificationInd 1235 * @syscap SystemCapability.Telephony.SmsMms 1236 * @systemapi Hide this for inner system use. 1237 * @since 8 1238 */ 1239 export interface MmsNotificationInd { 1240 /** 1241 * Indicates the transaction ID for the MMS notification indication. 1242 * 1243 * @type { string } 1244 * @syscap SystemCapability.Telephony.SmsMms 1245 * @systemapi Hide this for inner system use. 1246 * @since 8 1247 */ 1248 transactionId: string; 1249 1250 /** 1251 * Indicates the message class for the MMS notification indication. 1252 * 1253 * @type { number } 1254 * @syscap SystemCapability.Telephony.SmsMms 1255 * @systemapi Hide this for inner system use. 1256 * @since 8 1257 */ 1258 messageClass: number; 1259 1260 /** 1261 * Indicates the message size for the MMS notification indication. 1262 * 1263 * @type { number } 1264 * @syscap SystemCapability.Telephony.SmsMms 1265 * @systemapi Hide this for inner system use. 1266 * @since 8 1267 */ 1268 messageSize: number; 1269 1270 /** 1271 * Indicates the expiration for the MMS notification indication. 1272 * 1273 * @type { number } 1274 * @syscap SystemCapability.Telephony.SmsMms 1275 * @systemapi Hide this for inner system use. 1276 * @since 8 1277 */ 1278 expiry: number; 1279 1280 /** 1281 * Indicates the content location for the MMS notification indication. 1282 * 1283 * @type { string } 1284 * @syscap SystemCapability.Telephony.SmsMms 1285 * @systemapi Hide this for inner system use. 1286 * @since 8 1287 */ 1288 contentLocation: string; 1289 1290 /** 1291 * Indicates the version for the MMS notification indication. 1292 * 1293 * @type { MmsVersionType } 1294 * @syscap SystemCapability.Telephony.SmsMms 1295 * @systemapi Hide this for inner system use. 1296 * @since 8 1297 */ 1298 version: MmsVersionType; 1299 1300 /** 1301 * Indicates the source address for the MMS notification indication. 1302 * 1303 * @type { ?MmsAddress } 1304 * @syscap SystemCapability.Telephony.SmsMms 1305 * @systemapi Hide this for inner system use. 1306 * @since 8 1307 */ 1308 from?: MmsAddress; 1309 1310 /** 1311 * Indicates the subject for the MMS notification indication. 1312 * 1313 * @type { ?string } 1314 * @syscap SystemCapability.Telephony.SmsMms 1315 * @systemapi Hide this for inner system use. 1316 * @since 8 1317 */ 1318 subject?: string; 1319 1320 /** 1321 * Indicates the status report for the MMS notification indication. 1322 * 1323 * @type { ?number } 1324 * @syscap SystemCapability.Telephony.SmsMms 1325 * @systemapi Hide this for inner system use. 1326 * @since 8 1327 */ 1328 deliveryReport?: number; 1329 1330 /** 1331 * Indicates the content class for the MMS notification indication. 1332 * 1333 * @type { ?number } 1334 * @syscap SystemCapability.Telephony.SmsMms 1335 * @systemapi Hide this for inner system use. 1336 * @since 8 1337 */ 1338 contentClass?: number; 1339 } 1340 1341 /** 1342 * Defines an MMS response indication. 1343 * 1344 * @interface MmsRespInd 1345 * @syscap SystemCapability.Telephony.SmsMms 1346 * @systemapi Hide this for inner system use. 1347 * @since 8 1348 */ 1349 export interface MmsRespInd { 1350 /** 1351 * Indicates the event ID for the MMS response indication. 1352 * 1353 * @type { string } 1354 * @syscap SystemCapability.Telephony.SmsMms 1355 * @systemapi Hide this for inner system use. 1356 * @since 8 1357 */ 1358 transactionId: string; 1359 1360 /** 1361 * Indicates the status for the MMS response indication. 1362 * 1363 * @type { number } 1364 * @syscap SystemCapability.Telephony.SmsMms 1365 * @systemapi Hide this for inner system use. 1366 * @since 8 1367 */ 1368 status: number; 1369 1370 /** 1371 * Indicates the version for the MMS response indication. 1372 * 1373 * @type { MmsVersionType } 1374 * @syscap SystemCapability.Telephony.SmsMms 1375 * @systemapi Hide this for inner system use. 1376 * @since 8 1377 */ 1378 version: MmsVersionType; 1379 1380 /** 1381 * Indicates the report allowed for the MMS response indication. 1382 * 1383 * @type { ?ReportType } 1384 * @syscap SystemCapability.Telephony.SmsMms 1385 * @systemapi Hide this for inner system use. 1386 * @since 8 1387 */ 1388 reportAllowed?: ReportType; 1389 } 1390 1391 /** 1392 * Defines the MMS message retrieval configuration. 1393 * 1394 * @interface MmsRetrieveConf 1395 * @syscap SystemCapability.Telephony.SmsMms 1396 * @systemapi Hide this for inner system use. 1397 * @since 8 1398 */ 1399 export interface MmsRetrieveConf { 1400 /** 1401 * Indicates the transaction ID for the MMS message retrieval configuration. 1402 * 1403 * @type { string } 1404 * @syscap SystemCapability.Telephony.SmsMms 1405 * @systemapi Hide this for inner system use. 1406 * @since 8 1407 */ 1408 transactionId: string; 1409 1410 /** 1411 * Indicates the message ID for the MMS message retrieval configuration. 1412 * 1413 * @type { string } 1414 * @syscap SystemCapability.Telephony.SmsMms 1415 * @systemapi Hide this for inner system use. 1416 * @since 8 1417 */ 1418 messageId: string; 1419 1420 /** 1421 * Indicates the date for the MMS message retrieval configuration. 1422 * 1423 * @type { number } 1424 * @syscap SystemCapability.Telephony.SmsMms 1425 * @systemapi Hide this for inner system use. 1426 * @since 8 1427 */ 1428 date: number; 1429 1430 /** 1431 * Indicates the content type for the MMS message retrieval configuration. 1432 * 1433 * @type { string } 1434 * @syscap SystemCapability.Telephony.SmsMms 1435 * @systemapi Hide this for inner system use. 1436 * @since 8 1437 */ 1438 contentType: string; 1439 1440 /** 1441 * Indicates the destination address for the MMS message retrieval configuration. 1442 * 1443 * @type { Array<MmsAddress> } 1444 * @syscap SystemCapability.Telephony.SmsMms 1445 * @systemapi Hide this for inner system use. 1446 * @since 8 1447 */ 1448 to: Array<MmsAddress>; 1449 1450 /** 1451 * Indicates the version for the MMS message retrieval configuration. 1452 * 1453 * @type { MmsVersionType } 1454 * @syscap SystemCapability.Telephony.SmsMms 1455 * @systemapi Hide this for inner system use. 1456 * @since 8 1457 */ 1458 version: MmsVersionType; 1459 1460 /** 1461 * Indicates the source address for the MMS message retrieval configuration. 1462 * 1463 * @type { ?MmsAddress } 1464 * @syscap SystemCapability.Telephony.SmsMms 1465 * @systemapi Hide this for inner system use. 1466 * @since 8 1467 */ 1468 from?: MmsAddress; 1469 1470 /** 1471 * Indicates the carbon copy address for the MMS message retrieval configuration. 1472 * 1473 * @type { ?Array<MmsAddress> } 1474 * @syscap SystemCapability.Telephony.SmsMms 1475 * @systemapi Hide this for inner system use. 1476 * @since 8 1477 */ 1478 cc?: Array<MmsAddress>; 1479 1480 /** 1481 * Indicates the subject for the MMS message retrieval configuration. 1482 * 1483 * @type { ?string } 1484 * @syscap SystemCapability.Telephony.SmsMms 1485 * @systemapi Hide this for inner system use. 1486 * @since 8 1487 */ 1488 subject?: string; 1489 1490 /** 1491 * Indicates the priority for the MMS message retrieval configuration. 1492 * 1493 * @type { ?MmsPriorityType } 1494 * @syscap SystemCapability.Telephony.SmsMms 1495 * @systemapi Hide this for inner system use. 1496 * @since 8 1497 */ 1498 priority?: MmsPriorityType; 1499 1500 /** 1501 * Indicates the status report for the MMS message retrieval configuration. 1502 * 1503 * @type { ?number } 1504 * @syscap SystemCapability.Telephony.SmsMms 1505 * @systemapi Hide this for inner system use. 1506 * @since 8 1507 */ 1508 deliveryReport?: number; 1509 1510 /** 1511 * Indicates the read report for the MMS message retrieval configuration. 1512 * 1513 * @type { ?number } 1514 * @syscap SystemCapability.Telephony.SmsMms 1515 * @systemapi Hide this for inner system use. 1516 * @since 8 1517 */ 1518 readReport?: number; 1519 1520 /** 1521 * Indicates the retrieval status for the MMS message retrieval configuration. 1522 * 1523 * @type { ?number } 1524 * @syscap SystemCapability.Telephony.SmsMms 1525 * @systemapi Hide this for inner system use. 1526 * @since 8 1527 */ 1528 retrieveStatus?: number; 1529 1530 /** 1531 * Indicates the retrieval text for the MMS message retrieval configuration. 1532 * 1533 * @type { ?string } 1534 * @syscap SystemCapability.Telephony.SmsMms 1535 * @systemapi Hide this for inner system use. 1536 * @since 8 1537 */ 1538 retrieveText?: string; 1539 } 1540 1541 /** 1542 * Defines an MMS confirmation indication. 1543 * 1544 * @interface MmsAcknowledgeInd 1545 * @syscap SystemCapability.Telephony.SmsMms 1546 * @systemapi Hide this for inner system use. 1547 * @since 8 1548 */ 1549 export interface MmsAcknowledgeInd { 1550 /** 1551 * Indicates the transaction ID for the MMS confirmation indication. 1552 * 1553 * @type { string } 1554 * @syscap SystemCapability.Telephony.SmsMms 1555 * @systemapi Hide this for inner system use. 1556 * @since 8 1557 */ 1558 transactionId: string; 1559 1560 /** 1561 * Indicates the version for the MMS confirmation indication. 1562 * 1563 * @type { MmsVersionType } 1564 * @syscap SystemCapability.Telephony.SmsMms 1565 * @systemapi Hide this for inner system use. 1566 * @since 8 1567 */ 1568 version: MmsVersionType; 1569 1570 /** 1571 * Indicates the report allowed for the MMS confirmation indication. 1572 * 1573 * @type { ?ReportType } 1574 * @syscap SystemCapability.Telephony.SmsMms 1575 * @systemapi Hide this for inner system use. 1576 * @since 8 1577 */ 1578 reportAllowed?: ReportType; 1579 } 1580 1581 /** 1582 * Defines an MMS message delivery indication. 1583 * 1584 * @interface MmsDeliveryInd 1585 * @syscap SystemCapability.Telephony.SmsMms 1586 * @systemapi Hide this for inner system use. 1587 * @since 8 1588 */ 1589 export interface MmsDeliveryInd { 1590 /** 1591 * Indicates the message ID for the MMS message delivery indication. 1592 * 1593 * @type { string } 1594 * @syscap SystemCapability.Telephony.SmsMms 1595 * @systemapi Hide this for inner system use. 1596 * @since 8 1597 */ 1598 messageId: string; 1599 1600 /** 1601 * Indicates the date for the MMS message delivery indication. 1602 * 1603 * @type { number } 1604 * @syscap SystemCapability.Telephony.SmsMms 1605 * @systemapi Hide this for inner system use. 1606 * @since 8 1607 */ 1608 date: number; 1609 1610 /** 1611 * Indicates the destination address for the MMS message delivery indication. 1612 * 1613 * @type { Array<MmsAddress> } 1614 * @syscap SystemCapability.Telephony.SmsMms 1615 * @systemapi Hide this for inner system use. 1616 * @since 8 1617 */ 1618 to: Array<MmsAddress>; 1619 1620 /** 1621 * Indicates the status for the MMS message delivery indication. 1622 * 1623 * @type { number } 1624 * @syscap SystemCapability.Telephony.SmsMms 1625 * @systemapi Hide this for inner system use. 1626 * @since 8 1627 */ 1628 status: number; 1629 1630 /** 1631 * Indicates the version for the MMS message delivery indication. 1632 * 1633 * @type { MmsVersionType } 1634 * @syscap SystemCapability.Telephony.SmsMms 1635 * @systemapi Hide this for inner system use. 1636 * @since 8 1637 */ 1638 version: MmsVersionType; 1639 } 1640 1641 /** 1642 * Defines the original MMS message reading indication. 1643 * 1644 * @interface MmsReadOrigInd 1645 * @syscap SystemCapability.Telephony.SmsMms 1646 * @systemapi Hide this for inner system use. 1647 * @since 8 1648 */ 1649 export interface MmsReadOrigInd { 1650 /** 1651 * Indicates the version for the original MMS message reading indication. 1652 * 1653 * @type { MmsVersionType } 1654 * @syscap SystemCapability.Telephony.SmsMms 1655 * @systemapi Hide this for inner system use. 1656 * @since 8 1657 */ 1658 version: MmsVersionType; 1659 1660 /** 1661 * Indicates the message ID for the original MMS message reading indication. 1662 * 1663 * @type { string } 1664 * @syscap SystemCapability.Telephony.SmsMms 1665 * @systemapi Hide this for inner system use. 1666 * @since 8 1667 */ 1668 messageId: string; 1669 1670 /** 1671 * Indicates the destination address for the original MMS message reading indication. 1672 * 1673 * @type { Array<MmsAddress> } 1674 * @syscap SystemCapability.Telephony.SmsMms 1675 * @systemapi Hide this for inner system use. 1676 * @since 8 1677 */ 1678 to: Array<MmsAddress>; 1679 1680 /** 1681 * Indicates the source address for the original MMS message reading indication. 1682 * 1683 * @type { MmsAddress } 1684 * @syscap SystemCapability.Telephony.SmsMms 1685 * @systemapi Hide this for inner system use. 1686 * @since 8 1687 */ 1688 from: MmsAddress; 1689 1690 /** 1691 * Indicates the date for the original MMS message reading indication. 1692 * 1693 * @type { number } 1694 * @syscap SystemCapability.Telephony.SmsMms 1695 * @systemapi Hide this for inner system use. 1696 * @since 8 1697 */ 1698 date: number; 1699 1700 /** 1701 * Indicates the read status for the original MMS message reading indication. 1702 * 1703 * @type { number } 1704 * @syscap SystemCapability.Telephony.SmsMms 1705 * @systemapi Hide this for inner system use. 1706 * @since 8 1707 */ 1708 readStatus: number; 1709 } 1710 1711 /** 1712 * Defines the MMS message reading indication. 1713 * 1714 * @interface MmsReadRecInd 1715 * @syscap SystemCapability.Telephony.SmsMms 1716 * @systemapi Hide this for inner system use. 1717 * @since 8 1718 */ 1719 export interface MmsReadRecInd { 1720 /** 1721 * Indicates the version for the MMS message reading indication. 1722 * 1723 * @type { MmsVersionType } 1724 * @syscap SystemCapability.Telephony.SmsMms 1725 * @systemapi Hide this for inner system use. 1726 * @since 8 1727 */ 1728 version: MmsVersionType; 1729 1730 /** 1731 * Indicates the message ID for the MMS message reading indication. 1732 * 1733 * @type { string } 1734 * @syscap SystemCapability.Telephony.SmsMms 1735 * @systemapi Hide this for inner system use. 1736 * @since 8 1737 */ 1738 messageId: string; 1739 1740 /** 1741 * Indicates the destination address for the MMS message reading indication. 1742 * 1743 * @type { Array<MmsAddress> } 1744 * @syscap SystemCapability.Telephony.SmsMms 1745 * @systemapi Hide this for inner system use. 1746 * @since 8 1747 */ 1748 to: Array<MmsAddress>; 1749 1750 /** 1751 * Indicates the source address for the MMS message reading indication. 1752 * 1753 * @type { MmsAddress } 1754 * @syscap SystemCapability.Telephony.SmsMms 1755 * @systemapi Hide this for inner system use. 1756 * @since 8 1757 */ 1758 from: MmsAddress; 1759 1760 /** 1761 * Indicates the read status for the MMS message reading indication. 1762 * 1763 * @type { number } 1764 * @syscap SystemCapability.Telephony.SmsMms 1765 * @systemapi Hide this for inner system use. 1766 * @since 8 1767 */ 1768 readStatus: number; 1769 1770 /** 1771 * Indicates the date for the MMS message reading indication. 1772 * 1773 * @type { ?number } 1774 * @syscap SystemCapability.Telephony.SmsMms 1775 * @systemapi Hide this for inner system use. 1776 * @since 8 1777 */ 1778 date?: number; 1779 } 1780 1781 /** 1782 * Defines the attachment of an MMS message. 1783 * 1784 * @interface MmsAttachment 1785 * @syscap SystemCapability.Telephony.SmsMms 1786 * @systemapi Hide this for inner system use. 1787 * @since 8 1788 */ 1789 export interface MmsAttachment { 1790 /** 1791 * Indicates the content ID for the attachment. 1792 * 1793 * @type { string } 1794 * @syscap SystemCapability.Telephony.SmsMms 1795 * @systemapi Hide this for inner system use. 1796 * @since 8 1797 */ 1798 contentId: string; 1799 1800 /** 1801 * Indicates the content location. 1802 * 1803 * @type { string } 1804 * @syscap SystemCapability.Telephony.SmsMms 1805 * @systemapi Hide this for inner system use. 1806 * @since 8 1807 */ 1808 contentLocation: string; 1809 1810 /** 1811 * Indicates the content disposition for the attachment. 1812 * 1813 * @type { DispositionType } 1814 * @syscap SystemCapability.Telephony.SmsMms 1815 * @systemapi Hide this for inner system use. 1816 * @since 8 1817 */ 1818 contentDisposition: DispositionType; 1819 1820 /** 1821 * Indicates the encoding for content transfer. 1822 * 1823 * @type { string } 1824 * @syscap SystemCapability.Telephony.SmsMms 1825 * @systemapi Hide this for inner system use. 1826 * @since 8 1827 */ 1828 contentTransferEncoding: string; 1829 1830 /** 1831 * Indicates the content type for the attachment. 1832 * 1833 * @type { string } 1834 * @syscap SystemCapability.Telephony.SmsMms 1835 * @systemapi Hide this for inner system use. 1836 * @since 8 1837 */ 1838 contentType: string; 1839 1840 /** 1841 * Indicates whether the synchronized multimedia integration language is used. 1842 * 1843 * @type { boolean } 1844 * @syscap SystemCapability.Telephony.SmsMms 1845 * @systemapi Hide this for inner system use. 1846 * @since 8 1847 */ 1848 isSmil: boolean; 1849 1850 /** 1851 * Indicates the path for the attachment. 1852 * 1853 * @type { ?string } 1854 * @syscap SystemCapability.Telephony.SmsMms 1855 * @systemapi Hide this for inner system use. 1856 * @since 8 1857 */ 1858 path?: string; 1859 1860 /** 1861 * Indicates whether the message is in the buffer. 1862 * 1863 * @type { ?Array<number> } 1864 * @syscap SystemCapability.Telephony.SmsMms 1865 * @systemapi Hide this for inner system use. 1866 * @since 8 1867 */ 1868 inBuff?: Array<number>; 1869 1870 /** 1871 * Indicates the file name for the attachment. 1872 * 1873 * @type { ?string } 1874 * @syscap SystemCapability.Telephony.SmsMms 1875 * @systemapi Hide this for inner system use. 1876 * @since 8 1877 */ 1878 fileName?: string; 1879 1880 /** 1881 * Indicates the character set for the attachment. 1882 * 1883 * @type { ?MmsCharSets } 1884 * @syscap SystemCapability.Telephony.SmsMms 1885 * @systemapi Hide this for inner system use. 1886 * @since 8 1887 */ 1888 charset?: MmsCharSets; 1889 } 1890 1891 /** 1892 * Defines an MMSC address. 1893 * 1894 * @interface MmsAddress 1895 * @syscap SystemCapability.Telephony.SmsMms 1896 * @systemapi Hide this for inner system use. 1897 * @since 8 1898 */ 1899 export interface MmsAddress { 1900 /** 1901 * Indicates the network address for the MMSC address. 1902 * 1903 * @type { string } 1904 * @syscap SystemCapability.Telephony.SmsMms 1905 * @systemapi Hide this for inner system use. 1906 * @since 8 1907 */ 1908 address: string; 1909 1910 /** 1911 * Indicates the character set for the MMSC address. 1912 * 1913 * @type { MmsCharSets } 1914 * @syscap SystemCapability.Telephony.SmsMms 1915 * @systemapi Hide this for inner system use. 1916 * @since 8 1917 */ 1918 charset: MmsCharSets; 1919 } 1920 1921 /** 1922 * Enumerates message type. 1923 * 1924 * @enum { number } 1925 * @syscap SystemCapability.Telephony.SmsMms 1926 * @systemapi Hide this for inner system use. 1927 * @since 8 1928 */ 1929 export enum MessageType { 1930 /** 1931 * Indicates an MMS message sending request. 1932 * 1933 * @syscap SystemCapability.Telephony.SmsMms 1934 * @systemapi Hide this for inner system use. 1935 * @since 8 1936 */ 1937 TYPE_MMS_SEND_REQ = 128, 1938 1939 /** 1940 * Indicates an MMS message sending configuration. 1941 * 1942 * @syscap SystemCapability.Telephony.SmsMms 1943 * @systemapi Hide this for inner system use. 1944 * @since 8 1945 */ 1946 TYPE_MMS_SEND_CONF, 1947 1948 /** 1949 * Indicates an MMS notification. 1950 * 1951 * @syscap SystemCapability.Telephony.SmsMms 1952 * @systemapi Hide this for inner system use. 1953 * @since 8 1954 */ 1955 TYPE_MMS_NOTIFICATION_IND, 1956 1957 /** 1958 * Indicates an MMS message response. 1959 * 1960 * @syscap SystemCapability.Telephony.SmsMms 1961 * @systemapi Hide this for inner system use. 1962 * @since 8 1963 */ 1964 TYPE_MMS_RESP_IND, 1965 1966 /** 1967 * Indicates an MMS message retrieval configuration. 1968 * 1969 * @syscap SystemCapability.Telephony.SmsMms 1970 * @systemapi Hide this for inner system use. 1971 * @since 8 1972 */ 1973 TYPE_MMS_RETRIEVE_CONF, 1974 1975 /** 1976 * Indicates the type of multimedia message confirmation index. 1977 * 1978 * @syscap SystemCapability.Telephony.SmsMms 1979 * @systemapi Hide this for inner system use. 1980 * @since 8 1981 */ 1982 TYPE_MMS_ACKNOWLEDGE_IND, 1983 1984 /** 1985 * Indicates an MMS message delivery. 1986 * 1987 * @syscap SystemCapability.Telephony.SmsMms 1988 * @systemapi Hide this for inner system use. 1989 * @since 8 1990 */ 1991 TYPE_MMS_DELIVERY_IND, 1992 1993 /** 1994 * Indicates an MMS message read report on the recipient side. 1995 * 1996 * @syscap SystemCapability.Telephony.SmsMms 1997 * @systemapi Hide this for inner system use. 1998 * @since 8 1999 */ 2000 TYPE_MMS_READ_REC_IND, 2001 2002 /** 2003 * Indicates an original MMS message read report on the originating side. 2004 * 2005 * @syscap SystemCapability.Telephony.SmsMms 2006 * @systemapi Hide this for inner system use. 2007 * @since 8 2008 */ 2009 TYPE_MMS_READ_ORIG_IND, 2010 } 2011 2012 /** 2013 * Enumerates MMS message priorities. 2014 * 2015 * @enum { number } 2016 * @syscap SystemCapability.Telephony.SmsMms 2017 * @systemapi Hide this for inner system use. 2018 * @since 8 2019 */ 2020 export enum MmsPriorityType { 2021 /** 2022 * Indicates low priority. 2023 * 2024 * @syscap SystemCapability.Telephony.SmsMms 2025 * @systemapi Hide this for inner system use. 2026 * @since 8 2027 */ 2028 MMS_LOW = 128, 2029 2030 /** 2031 * Indicates normal priority. 2032 * 2033 * @syscap SystemCapability.Telephony.SmsMms 2034 * @systemapi Hide this for inner system use. 2035 * @since 8 2036 */ 2037 MMS_NORMAL, 2038 2039 /** 2040 * Indicates high priority. 2041 * 2042 * @syscap SystemCapability.Telephony.SmsMms 2043 * @systemapi Hide this for inner system use. 2044 * @since 8 2045 */ 2046 MMS_HIGH, 2047 } 2048 2049 /** 2050 * Enumerates MMS versions. 2051 * 2052 * @enum { number } 2053 * @syscap SystemCapability.Telephony.SmsMms 2054 * @systemapi Hide this for inner system use. 2055 * @since 8 2056 */ 2057 export enum MmsVersionType { 2058 /** 2059 * Indicates MMS version 1_0. 2060 * 2061 * @syscap SystemCapability.Telephony.SmsMms 2062 * @systemapi Hide this for inner system use. 2063 * @since 8 2064 */ 2065 MMS_VERSION_1_0 = 0x10, 2066 2067 /** 2068 * Indicates MMS version 1_1. 2069 * 2070 * @syscap SystemCapability.Telephony.SmsMms 2071 * @systemapi Hide this for inner system use. 2072 * @since 8 2073 */ 2074 MMS_VERSION_1_1, 2075 2076 /** 2077 * Indicates MMS version 1_2. 2078 * 2079 * @syscap SystemCapability.Telephony.SmsMms 2080 * @systemapi Hide this for inner system use. 2081 * @since 8 2082 */ 2083 MMS_VERSION_1_2, 2084 2085 /** 2086 * Indicates MMS version 1_3. 2087 * 2088 * @syscap SystemCapability.Telephony.SmsMms 2089 * @systemapi Hide this for inner system use. 2090 * @since 8 2091 */ 2092 MMS_VERSION_1_3, 2093 } 2094 2095 /** 2096 * Enumerates MMS character sets. 2097 * 2098 * @enum { number } 2099 * @syscap SystemCapability.Telephony.SmsMms 2100 * @systemapi Hide this for inner system use. 2101 * @since 8 2102 */ 2103 export enum MmsCharSets { 2104 /** 2105 * Indicates the BIG5 format. 2106 * 2107 * @syscap SystemCapability.Telephony.SmsMms 2108 * @systemapi Hide this for inner system use. 2109 * @since 8 2110 */ 2111 BIG5 = 0X07EA, 2112 2113 /** 2114 * Indicates the ISO_10646_UCS_2 format. 2115 * 2116 * @syscap SystemCapability.Telephony.SmsMms 2117 * @systemapi Hide this for inner system use. 2118 * @since 8 2119 */ 2120 ISO_10646_UCS_2 = 0X03E8, 2121 2122 /** 2123 * Indicates the ISO_8859_1 format. 2124 * 2125 * @syscap SystemCapability.Telephony.SmsMms 2126 * @systemapi Hide this for inner system use. 2127 * @since 8 2128 */ 2129 ISO_8859_1 = 0X04, 2130 2131 /** 2132 * Indicates the ISO_8859_2 format. 2133 * 2134 * @syscap SystemCapability.Telephony.SmsMms 2135 * @systemapi Hide this for inner system use. 2136 * @since 8 2137 */ 2138 ISO_8859_2, 2139 2140 /** 2141 * Indicates the ISO_8859_3 format. 2142 * 2143 * @syscap SystemCapability.Telephony.SmsMms 2144 * @systemapi Hide this for inner system use. 2145 * @since 8 2146 */ 2147 ISO_8859_3, 2148 2149 /** 2150 * Indicates the ISO_8859_4 format. 2151 * 2152 * @syscap SystemCapability.Telephony.SmsMms 2153 * @systemapi Hide this for inner system use. 2154 * @since 8 2155 */ 2156 ISO_8859_4, 2157 2158 /** 2159 * Indicates the ISO_8859_5 format. 2160 * 2161 * @syscap SystemCapability.Telephony.SmsMms 2162 * @systemapi Hide this for inner system use. 2163 * @since 8 2164 */ 2165 ISO_8859_5, 2166 2167 /** 2168 * Indicates the ISO_8859_6 format. 2169 * 2170 * @syscap SystemCapability.Telephony.SmsMms 2171 * @systemapi Hide this for inner system use. 2172 * @since 8 2173 */ 2174 ISO_8859_6, 2175 2176 /** 2177 * Indicates the ISO_8859_7 format. 2178 * 2179 * @syscap SystemCapability.Telephony.SmsMms 2180 * @systemapi Hide this for inner system use. 2181 * @since 8 2182 */ 2183 ISO_8859_7, 2184 2185 /** 2186 * Indicates the ISO_8859_8 format. 2187 * 2188 * @syscap SystemCapability.Telephony.SmsMms 2189 * @systemapi Hide this for inner system use. 2190 * @since 8 2191 */ 2192 ISO_8859_8, 2193 2194 /** 2195 * Indicates the ISO_8859_9 format. 2196 * 2197 * @syscap SystemCapability.Telephony.SmsMms 2198 * @systemapi Hide this for inner system use. 2199 * @since 8 2200 */ 2201 ISO_8859_9, 2202 2203 /** 2204 * Indicates the SHIFT_JIS format. 2205 * 2206 * @syscap SystemCapability.Telephony.SmsMms 2207 * @systemapi Hide this for inner system use. 2208 * @since 8 2209 */ 2210 SHIFT_JIS = 0X11, 2211 2212 /** 2213 * Indicates the US_ASCII format. 2214 * 2215 * @syscap SystemCapability.Telephony.SmsMms 2216 * @systemapi Hide this for inner system use. 2217 * @since 8 2218 */ 2219 US_ASCII = 0X03, 2220 2221 /** 2222 * Indicates the UTF_8 format. 2223 * 2224 * @syscap SystemCapability.Telephony.SmsMms 2225 * @systemapi Hide this for inner system use. 2226 * @since 8 2227 */ 2228 UTF_8 = 0X6A, 2229 } 2230 2231 /** 2232 * Enumerates disposition types. 2233 * 2234 * @enum { number } 2235 * @syscap SystemCapability.Telephony.SmsMms 2236 * @systemapi Hide this for inner system use. 2237 * @since 8 2238 */ 2239 export enum DispositionType { 2240 /** 2241 * Indicates the data source type. 2242 * 2243 * @syscap SystemCapability.Telephony.SmsMms 2244 * @systemapi Hide this for inner system use. 2245 * @since 8 2246 */ 2247 FROM_DATA = 0, 2248 2249 /** 2250 * Indicates the attachment type. 2251 * 2252 * @syscap SystemCapability.Telephony.SmsMms 2253 * @systemapi Hide this for inner system use. 2254 * @since 8 2255 */ 2256 ATTACHMENT, 2257 2258 /** 2259 * Indicates the inlining type. 2260 * 2261 * @syscap SystemCapability.Telephony.SmsMms 2262 * @systemapi Hide this for inner system use. 2263 * @since 8 2264 */ 2265 INLINE, 2266 } 2267 2268 /** 2269 * Enumerates report types. 2270 * 2271 * @enum { number } 2272 * @syscap SystemCapability.Telephony.SmsMms 2273 * @systemapi Hide this for inner system use. 2274 * @since 8 2275 */ 2276 export enum ReportType { 2277 /** 2278 * Indicates that a report is required. 2279 * 2280 * @syscap SystemCapability.Telephony.SmsMms 2281 * @systemapi Hide this for inner system use. 2282 * @since 8 2283 */ 2284 MMS_YES = 128, 2285 2286 /** 2287 * Indicates that a report is not required. 2288 * 2289 * @syscap SystemCapability.Telephony.SmsMms 2290 * @systemapi Hide this for inner system use. 2291 * @since 8 2292 */ 2293 MMS_NO, 2294 } 2295 2296 /** 2297 * Defines the cell broadcast configuration options. 2298 * 2299 * @interface CBConfigOptions 2300 * @syscap SystemCapability.Telephony.SmsMms 2301 * @systemapi Hide this for inner system use. 2302 * @since 7 2303 */ 2304 export interface CBConfigOptions { 2305 /** 2306 * Indicates the card slot ID for the cell broadcast configuration options. 2307 * 2308 * @type { number } 2309 * @syscap SystemCapability.Telephony.SmsMms 2310 * @systemapi Hide this for inner system use. 2311 * @since 7 2312 */ 2313 slotId: number; 2314 2315 /** 2316 * Indicates whether to enable cell broadcast. 2317 * 2318 * @type { boolean } 2319 * @syscap SystemCapability.Telephony.SmsMms 2320 * @systemapi Hide this for inner system use. 2321 * @since 7 2322 */ 2323 enable: boolean; 2324 2325 /** 2326 * Indicates the start message ID for the cell broadcast configuration options. 2327 * 2328 * @type { number } 2329 * @syscap SystemCapability.Telephony.SmsMms 2330 * @systemapi Hide this for inner system use. 2331 * @since 7 2332 */ 2333 startMessageId: number; 2334 2335 /** 2336 * Indicates the end message ID for the cell broadcast configuration options. 2337 * 2338 * @type { number } 2339 * @syscap SystemCapability.Telephony.SmsMms 2340 * @systemapi Hide this for inner system use. 2341 * @since 7 2342 */ 2343 endMessageId: number; 2344 2345 /** 2346 * Indicates the RAN type for the cell broadcast configuration options. 2347 * 2348 * @type { RanType } 2349 * @syscap SystemCapability.Telephony.SmsMms 2350 * @systemapi Hide this for inner system use. 2351 * @since 7 2352 */ 2353 ranType: RanType; 2354 } 2355 2356 /** 2357 * Defines the cell broadcast configuration list options. 2358 * 2359 * @interface CBConfigListOptions 2360 * @syscap SystemCapability.Telephony.SmsMms 2361 * @systemapi Hide this for inner system use. 2362 * @since 7 2363 */ 2364 export interface CBConfigListOptions { 2365 /** 2366 * Indicates the card slot ID for the cell broadcast configuration list options. 2367 * 2368 * @type { number } 2369 * @syscap SystemCapability.Telephony.SmsMms 2370 * @systemapi Hide this for inner system use. 2371 * @since 7 2372 */ 2373 slotId: number; 2374 2375 /** 2376 * Indicates the messageIDs for the cell broadcast configuration list options. 2377 * 2378 * @type { number[] } 2379 * @syscap SystemCapability.Telephony.SmsMms 2380 * @systemapi Hide this for inner system use. 2381 * @since 7 2382 */ 2383 messageIds: number[]; 2384 2385 /** 2386 * Indicates the RAN type for the cell broadcast configuration list options. 2387 * 2388 * @type { RanType } 2389 * @syscap SystemCapability.Telephony.SmsMms 2390 * @systemapi Hide this for inner system use. 2391 * @since 7 2392 */ 2393 ranType: RanType; 2394 } 2395 2396 /** 2397 * Defines the SIM message options. 2398 * 2399 * @interface SimMessageOptions 2400 * @syscap SystemCapability.Telephony.SmsMms 2401 * @systemapi Hide this for inner system use. 2402 * @since 7 2403 */ 2404 export interface SimMessageOptions { 2405 /** 2406 * Indicates the card slot ID for the SIM message options. 2407 * 2408 * @type { number } 2409 * @syscap SystemCapability.Telephony.SmsMms 2410 * @systemapi Hide this for inner system use. 2411 * @since 7 2412 */ 2413 slotId: number; 2414 2415 /** 2416 * Indicates the short message service center for the SIM message options. 2417 * 2418 * @type { string } 2419 * @syscap SystemCapability.Telephony.SmsMms 2420 * @systemapi Hide this for inner system use. 2421 * @since 7 2422 */ 2423 smsc: string; 2424 2425 /** 2426 * Indicates the protocol data unit for the SIM message options. 2427 * 2428 * @type { string } 2429 * @syscap SystemCapability.Telephony.SmsMms 2430 * @systemapi Hide this for inner system use. 2431 * @since 7 2432 */ 2433 pdu: string; 2434 2435 /** 2436 * Indicates the status for the SIM message options. 2437 * 2438 * @type { SimMessageStatus } 2439 * @syscap SystemCapability.Telephony.SmsMms 2440 * @systemapi Hide this for inner system use. 2441 * @since 7 2442 */ 2443 status: SimMessageStatus; 2444 } 2445 2446 /** 2447 * Defines the updating SIM message options. 2448 * 2449 * @interface UpdateSimMessageOptions 2450 * @syscap SystemCapability.Telephony.SmsMms 2451 * @systemapi Hide this for inner system use. 2452 * @since 7 2453 */ 2454 export interface UpdateSimMessageOptions { 2455 /** 2456 * Indicates the card slot ID for the updating SIM message options. 2457 * 2458 * @type { number } 2459 * @syscap SystemCapability.Telephony.SmsMms 2460 * @systemapi Hide this for inner system use. 2461 * @since 7 2462 */ 2463 slotId: number; 2464 2465 /** 2466 * Indicates the message index for the updating SIM message options. 2467 * 2468 * @type { number } 2469 * @syscap SystemCapability.Telephony.SmsMms 2470 * @systemapi Hide this for inner system use. 2471 * @since 7 2472 */ 2473 msgIndex: number; 2474 2475 /** 2476 * Indicates the new status for the updating SIM message options. 2477 * 2478 * @type { SimMessageStatus } 2479 * @syscap SystemCapability.Telephony.SmsMms 2480 * @systemapi Hide this for inner system use. 2481 * @since 7 2482 */ 2483 newStatus: SimMessageStatus; 2484 2485 /** 2486 * Indicates the protocol data unit for the updating SIM message options. 2487 * 2488 * @type { string } 2489 * @syscap SystemCapability.Telephony.SmsMms 2490 * @systemapi Hide this for inner system use. 2491 * @since 7 2492 */ 2493 pdu: string; 2494 2495 /** 2496 * Indicates the short message service center for the updating SIM message options. 2497 * 2498 * @type { string } 2499 * @syscap SystemCapability.Telephony.SmsMms 2500 * @systemapi Hide this for inner system use. 2501 * @since 7 2502 */ 2503 smsc: string; 2504 } 2505 2506 /** 2507 * Defines an SMS message instance. 2508 * 2509 * @interface ShortMessage 2510 * @syscap SystemCapability.Telephony.SmsMms 2511 * @since 6 2512 */ 2513 export interface ShortMessage { 2514 /** 2515 * Indicates the SMS message body. 2516 * 2517 * @type { string } 2518 * @syscap SystemCapability.Telephony.SmsMms 2519 * @since 6 2520 */ 2521 visibleMessageBody: string; 2522 2523 /** 2524 * Indicates the address of the sender, which is to be displayed on the UI. 2525 * 2526 * @type { string } 2527 * @syscap SystemCapability.Telephony.SmsMms 2528 * @since 6 2529 */ 2530 visibleRawAddress: string; 2531 2532 /** 2533 * Indicates the SMS type. 2534 * 2535 * @type { ShortMessageClass } 2536 * @syscap SystemCapability.Telephony.SmsMms 2537 * @since 6 2538 */ 2539 messageClass: ShortMessageClass; 2540 2541 /** 2542 * Indicates the protocol identifier. 2543 * 2544 * @type { number } 2545 * @syscap SystemCapability.Telephony.SmsMms 2546 * @since 6 2547 */ 2548 protocolId: number; 2549 2550 /** 2551 * Indicates the short message service center (SMSC) address. 2552 * 2553 * @type { string } 2554 * @syscap SystemCapability.Telephony.SmsMms 2555 * @since 6 2556 */ 2557 scAddress: string; 2558 2559 /** 2560 * Indicates the SMSC timestamp. 2561 * 2562 * @type { number } 2563 * @syscap SystemCapability.Telephony.SmsMms 2564 * @since 6 2565 */ 2566 scTimestamp: number; 2567 2568 /** 2569 * Indicates whether the received SMS is a "replace short message". 2570 * 2571 * @type { boolean } 2572 * @syscap SystemCapability.Telephony.SmsMms 2573 * @since 6 2574 */ 2575 isReplaceMessage: boolean; 2576 2577 /** 2578 * Indicates whether the received SMS contains "TP-Reply-Path". 2579 * 2580 * @type { boolean } 2581 * @syscap SystemCapability.Telephony.SmsMms 2582 * @since 6 2583 */ 2584 hasReplyPath: boolean; 2585 2586 /** 2587 * Indicates Protocol Data Units (PDUs) from an SMS message. 2588 * 2589 * @type { Array<number> } 2590 * @syscap SystemCapability.Telephony.SmsMms 2591 * @since 6 2592 */ 2593 pdu: Array<number>; 2594 2595 /** 2596 * Indicates the SMS message status from the SMS-STATUS-REPORT message sent by the 2597 * Short Message Service Center (SMSC). 2598 * 2599 * @type { number } 2600 * @syscap SystemCapability.Telephony.SmsMms 2601 * @since 6 2602 */ 2603 status: number; 2604 2605 /** 2606 * Indicates whether the current message is SMS-STATUS-REPORT. 2607 * 2608 * @type { boolean } 2609 * @syscap SystemCapability.Telephony.SmsMms 2610 * @since 6 2611 */ 2612 isSmsStatusReportMessage: boolean; 2613 } 2614 2615 /** 2616 * Defines a SIM message. 2617 * 2618 * @interface SimShortMessage 2619 * @syscap SystemCapability.Telephony.SmsMms 2620 * @systemapi Hide this for inner system use. 2621 * @since 7 2622 */ 2623 export interface SimShortMessage { 2624 /** 2625 * Indicates the SMS message in the SIM. 2626 * 2627 * @type { ShortMessage } 2628 * @syscap SystemCapability.Telephony.SmsMms 2629 * @systemapi Hide this for inner system use. 2630 * @since 7 2631 */ 2632 shortMessage: ShortMessage; 2633 2634 /** 2635 * Indicates the storage status of SMS messages in the SIM. 2636 * 2637 * @type { SimMessageStatus } 2638 * @syscap SystemCapability.Telephony.SmsMms 2639 * @systemapi Hide this for inner system use. 2640 * @since 7 2641 */ 2642 simMessageStatus: SimMessageStatus; 2643 2644 /** 2645 * Indicates the index of SMS messages in the SIM. 2646 * 2647 * @type { number } 2648 * @syscap SystemCapability.Telephony.SmsMms 2649 * @systemapi Hide this for inner system use. 2650 * @since 7 2651 */ 2652 indexOnSim: number; 2653 } 2654 2655 /** 2656 * Defines the SIM message status. 2657 * 2658 * @enum { number } 2659 * @syscap SystemCapability.Telephony.SmsMms 2660 * @systemapi Hide this for inner system use. 2661 * @since 7 2662 */ 2663 export enum SimMessageStatus { 2664 /** 2665 * Status free space on SIM. 2666 * 2667 * @syscap SystemCapability.Telephony.SmsMms 2668 * @systemapi Hide this for inner system use. 2669 * @since 7 2670 */ 2671 SIM_MESSAGE_STATUS_FREE = 0, 2672 2673 /** 2674 * Indicates a read message. 2675 * 2676 * @syscap SystemCapability.Telephony.SmsMms 2677 * @systemapi Hide this for inner system use. 2678 * @since 7 2679 */ 2680 SIM_MESSAGE_STATUS_READ = 1, 2681 2682 /** 2683 * Indicates an unread message. 2684 * 2685 * @syscap SystemCapability.Telephony.SmsMms 2686 * @systemapi Hide this for inner system use. 2687 * @since 7 2688 */ 2689 SIM_MESSAGE_STATUS_UNREAD = 3, 2690 2691 /** 2692 * Indicates a sent message (only applicable to SMS). 2693 * 2694 * @syscap SystemCapability.Telephony.SmsMms 2695 * @systemapi Hide this for inner system use. 2696 * @since 7 2697 */ 2698 SIM_MESSAGE_STATUS_SENT = 5, 2699 2700 /** 2701 * Indicates an unsent message (only applicable to SMS). 2702 * 2703 * @syscap SystemCapability.Telephony.SmsMms 2704 * @systemapi Hide this for inner system use. 2705 * @since 7 2706 */ 2707 SIM_MESSAGE_STATUS_UNSENT = 7, 2708 } 2709 2710 /** 2711 * Enumerates SMS message types. 2712 * 2713 * @enum { number } 2714 * @syscap SystemCapability.Telephony.SmsMms 2715 * @since 6 2716 */ 2717 export enum ShortMessageClass { 2718 /** 2719 * Indicates an unknown type. 2720 * 2721 * @syscap SystemCapability.Telephony.SmsMms 2722 * @since 6 2723 */ 2724 UNKNOWN, 2725 2726 /** 2727 * Indicates an instant message, which is displayed immediately after being received. 2728 * 2729 * @syscap SystemCapability.Telephony.SmsMms 2730 * @since 6 2731 */ 2732 INSTANT_MESSAGE, 2733 2734 /** 2735 * Indicates an SMS message that can be stored on the device or SIM card based on the storage status. 2736 * 2737 * @syscap SystemCapability.Telephony.SmsMms 2738 * @since 6 2739 */ 2740 OPTIONAL_MESSAGE, 2741 2742 /** 2743 * Indicates an SMS message containing SIM card information, which is to be stored in a SIM card. 2744 * 2745 * @syscap SystemCapability.Telephony.SmsMms 2746 * @since 6 2747 */ 2748 SIM_MESSAGE, 2749 2750 /** 2751 * Indicates an SMS message to be forwarded to another device. 2752 * 2753 * @syscap SystemCapability.Telephony.SmsMms 2754 * @since 6 2755 */ 2756 FORWARD_MESSAGE 2757 } 2758 2759 /** 2760 * Provides the options (including callbacks) for sending an SMS message. 2761 * 2762 * @interface SendMessageOptions 2763 * @syscap SystemCapability.Telephony.SmsMms 2764 * @since 6 2765 */ 2766 export interface SendMessageOptions { 2767 /** 2768 * Indicates the ID of the SIM card slot used for sending the SMS message. 2769 * 2770 * @type { number } 2771 * @syscap SystemCapability.Telephony.SmsMms 2772 * @since 6 2773 */ 2774 slotId: number; 2775 2776 /** 2777 * Indicates the address to which the SMS message is sent. 2778 * 2779 * @type { string } 2780 * @syscap SystemCapability.Telephony.SmsMms 2781 * @since 6 2782 */ 2783 destinationHost: string; 2784 2785 /** 2786 * Indicates the SMSC address. If the value is {@code null}, the default SMSC address of the SIM card. 2787 * 2788 * @type { ?string } 2789 * @syscap SystemCapability.Telephony.SmsMms 2790 * @since 6 2791 */ 2792 serviceCenter?: string; 2793 2794 /** 2795 * If the content is a string, this is a short message. If the content is a byte array, this is a data message. 2796 * 2797 * @type { string | Array<number> } 2798 * @syscap SystemCapability.Telephony.SmsMms 2799 * @since 6 2800 */ 2801 content: string | Array<number>; 2802 2803 /** 2804 * If send data message, destinationPort is mandatory. Otherwise is optional. 2805 * 2806 * @type { ?number } 2807 * @syscap SystemCapability.Telephony.SmsMms 2808 * @since 6 2809 */ 2810 destinationPort?: number; 2811 2812 /** 2813 * Indicates the callback invoked after the SMS message is sent. 2814 * 2815 * @type { ?AsyncCallback<ISendShortMessageCallback> } 2816 * @syscap SystemCapability.Telephony.SmsMms 2817 * @since 6 2818 */ 2819 sendCallback?: AsyncCallback<ISendShortMessageCallback>; 2820 2821 /** 2822 * Indicates the callback invoked after the SMS message is delivered. 2823 * 2824 * @type { ?AsyncCallback<IDeliveryShortMessageCallback> } 2825 * @syscap SystemCapability.Telephony.SmsMms 2826 * @since 6 2827 */ 2828 deliveryCallback?: AsyncCallback<IDeliveryShortMessageCallback>; 2829 2830 /** 2831 * Indicates whether the message is saved to database. 2832 * 2833 * @type { ?boolean } 2834 * @syscap SystemCapability.Telephony.SmsMms 2835 * @since 12 2836 */ 2837 isPersist?: boolean; 2838 } 2839 2840 /** 2841 * Provides the callback for the SMS message sending result. 2842 * 2843 * @interface ISendShortMessageCallback 2844 * @syscap SystemCapability.Telephony.SmsMms 2845 * @since 6 2846 */ 2847 export interface ISendShortMessageCallback { 2848 /** 2849 * Indicates the SMS message sending result. 2850 * 2851 * @type { SendSmsResult } 2852 * @syscap SystemCapability.Telephony.SmsMms 2853 * @since 6 2854 */ 2855 result: SendSmsResult; 2856 2857 /** 2858 * Indicates the URI to store the sent SMS message. 2859 * 2860 * @type { string } 2861 * @syscap SystemCapability.Telephony.SmsMms 2862 * @since 6 2863 */ 2864 url: string; 2865 2866 /** 2867 * Specifies whether this is the last part of a multi-part SMS message. 2868 * 2869 * @type { boolean } 2870 * @syscap SystemCapability.Telephony.SmsMms 2871 * @since 6 2872 */ 2873 isLastPart: boolean; 2874 } 2875 2876 /** 2877 * Provides the callback for the SMS message delivery report. 2878 * 2879 * @interface IDeliveryShortMessageCallback 2880 * @syscap SystemCapability.Telephony.SmsMms 2881 * @since 6 2882 */ 2883 export interface IDeliveryShortMessageCallback { 2884 /** 2885 * Indicates the SMS delivery report. 2886 * 2887 * @type { Array<number> } 2888 * @syscap SystemCapability.Telephony.SmsMms 2889 * @since 6 2890 */ 2891 pdu: Array<number>; 2892 } 2893 2894 /** 2895 * Enumerates SMS message sending results. 2896 * 2897 * @enum { number } 2898 * @syscap SystemCapability.Telephony.SmsMms 2899 * @since 6 2900 */ 2901 export enum SendSmsResult { 2902 /** 2903 * Indicates that the SMS message is successfully sent. 2904 * 2905 * @syscap SystemCapability.Telephony.SmsMms 2906 * @since 6 2907 */ 2908 SEND_SMS_SUCCESS = 0, 2909 2910 /** 2911 * Indicates that sending the SMS message fails due to an unknown reason. 2912 * 2913 * @syscap SystemCapability.Telephony.SmsMms 2914 * @since 6 2915 */ 2916 SEND_SMS_FAILURE_UNKNOWN = 1, 2917 2918 /** 2919 * Indicates that sending the SMS fails because the modem is powered off. 2920 * 2921 * @syscap SystemCapability.Telephony.SmsMms 2922 * @since 6 2923 */ 2924 SEND_SMS_FAILURE_RADIO_OFF = 2, 2925 2926 /** 2927 * Indicates that sending the SMS message fails because the network is unavailable 2928 * or does not support sending or reception of SMS messages. 2929 * 2930 * @syscap SystemCapability.Telephony.SmsMms 2931 * @since 6 2932 */ 2933 SEND_SMS_FAILURE_SERVICE_UNAVAILABLE = 3 2934 } 2935 2936 /** 2937 * Enumerates RAN type. 2938 * 2939 * @enum { number } 2940 * @syscap SystemCapability.Telephony.SmsMms 2941 * @systemapi Hide this for inner system use. 2942 * @since 7 2943 */ 2944 export enum RanType { 2945 /** 2946 * Indicates GSM type. 2947 * 2948 * @syscap SystemCapability.Telephony.SmsMms 2949 * @systemapi Hide this for inner system use. 2950 * @since 7 2951 */ 2952 TYPE_GSM = 1, 2953 2954 /** 2955 * Indicates CDMA type. 2956 * 2957 * @syscap SystemCapability.Telephony.SmsMms 2958 * @systemapi Hide this for inner system use. 2959 * @since 7 2960 */ 2961 TYPE_CDMA = 2, 2962 } 2963 2964 /** 2965 * Defines the SMS message segment information. 2966 * 2967 * @interface SmsSegmentsInfo 2968 * @syscap SystemCapability.Telephony.SmsMms 2969 * @systemapi Hide this for inner system use. 2970 * @since 8 2971 */ 2972 export interface SmsSegmentsInfo { 2973 /** 2974 * Indicates the split count for the SMS message segment information. 2975 * 2976 * @type { number } 2977 * @syscap SystemCapability.Telephony.SmsMms 2978 * @systemapi Hide this for inner system use. 2979 * @since 8 2980 */ 2981 splitCount: number; 2982 2983 /** 2984 * Indicates the encoding count for the SMS message segment information. 2985 * 2986 * @type { number } 2987 * @syscap SystemCapability.Telephony.SmsMms 2988 * @systemapi Hide this for inner system use. 2989 * @since 8 2990 */ 2991 encodeCount: number; 2992 2993 /** 2994 * Indicates the remaining encoding count for the SMS message segment information. 2995 * 2996 * @type { number } 2997 * @syscap SystemCapability.Telephony.SmsMms 2998 * @systemapi Hide this for inner system use. 2999 * @since 8 3000 */ 3001 encodeCountRemaining: number; 3002 3003 /** 3004 * Indicates the encoding scheme for the SMS message segment information. 3005 * 3006 * @type { SmsEncodingScheme } 3007 * @syscap SystemCapability.Telephony.SmsMms 3008 * @systemapi Hide this for inner system use. 3009 * @since 8 3010 */ 3011 scheme: SmsEncodingScheme; 3012 } 3013 3014 /** 3015 * Enumerates SMS encoding schemes. 3016 * 3017 * @enum { number } 3018 * @syscap SystemCapability.Telephony.SmsMms 3019 * @systemapi Hide this for inner system use. 3020 * @since 8 3021 */ 3022 export enum SmsEncodingScheme { 3023 /** 3024 * Indicates an unknown encoding schemes. 3025 * 3026 * @syscap SystemCapability.Telephony.SmsMms 3027 * @systemapi Hide this for inner system use. 3028 * @since 8 3029 */ 3030 SMS_ENCODING_UNKNOWN = 0, 3031 3032 /** 3033 * Indicates that the encoding schemes is 7-digit. 3034 * 3035 * @syscap SystemCapability.Telephony.SmsMms 3036 * @systemapi Hide this for inner system use. 3037 * @since 8 3038 */ 3039 SMS_ENCODING_7BIT, 3040 3041 /** 3042 * Indicates that the encoding schemes is 8-digit. 3043 * 3044 * @syscap SystemCapability.Telephony.SmsMms 3045 * @systemapi Hide this for inner system use. 3046 * @since 8 3047 */ 3048 SMS_ENCODING_8BIT, 3049 3050 /** 3051 * Indicates that the encoding schemes is 16-digit. 3052 * 3053 * @syscap SystemCapability.Telephony.SmsMms 3054 * @systemapi Hide this for inner system use. 3055 * @since 8 3056 */ 3057 SMS_ENCODING_16BIT, 3058 } 3059} 3060 3061export default sms; 3062