1/* 2 * Copyright (C) 2021-2024 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, Callback } from './@ohos.base'; 22 23/** 24 * Provides interfaces for applications to obtain the network state, cell information, signal information, 25 * and device ID of the wireless cellular network (WCN), and provides a callback registration mechanism to 26 * listen for changes of the network, cell, and signal status of the WCN. 27 * 28 * @namespace radio 29 * @syscap SystemCapability.Telephony.CoreService 30 * @since 6 31 */ 32declare namespace radio { 33 /** 34 * Obtains radio access technology (RAT) of the registered network. The system 35 * returns RAT of the packet service (PS) and circuit service (CS) domain. 36 * 37 * @permission ohos.permission.GET_NETWORK_INFO 38 * @param { number } slotId - Indicates the card slot index number, 39 * ranging from 0 to the maximum card slot index number supported by the device. 40 * @param { AsyncCallback<{psRadioTech: RadioTechnology, csRadioTech: RadioTechnology}> } callback - Returns 41 * an integer indicating the RAT in use. The values are as follows: 42 * <ul> 43 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_UNKNOWN} 44 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_GSM} 45 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_1XRTT} 46 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_WCDMA} 47 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_HSPA} 48 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_HSPAP} 49 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_TD_SCDMA} 50 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_EVDO} 51 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_EHRPD} 52 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_LTE} 53 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_LTE_CA} 54 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_IWLAN} 55 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_NR} 56 * </ul> 57 * @throws { BusinessError } 201 - Permission denied. 58 * @throws { BusinessError } 401 - Parameter error. 59 * @throws { BusinessError } 8300001 - Invalid parameter value. 60 * @throws { BusinessError } 8300002 - Service connection failed. 61 * @throws { BusinessError } 8300003 - System internal error. 62 * @throws { BusinessError } 8300999 - Unknown error. 63 * @syscap SystemCapability.Telephony.CoreService 64 * @since 6 65 */ 66 /** 67 * Obtains radio access technology (RAT) of the registered network. The system 68 * returns RAT of the packet service (PS) and circuit service (CS) domain. 69 * 70 * @permission ohos.permission.GET_NETWORK_INFO 71 * @param { number } slotId - Indicates the card slot index number, 72 * ranging from 0 to the maximum card slot index number supported by the device. 73 * @param { AsyncCallback<NetworkRadioTech> } callback - Returns 74 * the RAT of PS domain and CS domain of registered network. 75 * The values of RAT are as follows: 76 * <ul> 77 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_UNKNOWN} 78 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_GSM} 79 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_1XRTT} 80 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_WCDMA} 81 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_HSPA} 82 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_HSPAP} 83 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_TD_SCDMA} 84 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_EVDO} 85 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_EHRPD} 86 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_LTE} 87 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_LTE_CA} 88 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_IWLAN} 89 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_NR} 90 * </ul> 91 * @throws { BusinessError } 201 - Permission denied. 92 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 93 * 2. Incorrect parameter types. 94 * @throws { BusinessError } 8300001 - Invalid parameter value. 95 * @throws { BusinessError } 8300002 - Service connection failed. 96 * @throws { BusinessError } 8300003 - System internal error. 97 * @throws { BusinessError } 8300999 - Unknown error. 98 * @syscap SystemCapability.Telephony.CoreService 99 * @since 11 100 */ 101 function getRadioTech(slotId: number, callback: AsyncCallback<NetworkRadioTech>): void; 102 103 /** 104 * Obtains radio access technology (RAT) of the registered network. The system 105 * returns RAT of the packet service (PS) and circuit service (CS) domain. 106 * 107 * @permission ohos.permission.GET_NETWORK_INFO 108 * @param { number } slotId - Indicates the card slot index number, 109 * ranging from 0 to the maximum card slot index number supported by the device. 110 * @returns { Promise<{psRadioTech: RadioTechnology, csRadioTech: RadioTechnology}> } Returns 111 * the enumeration of RadioTechnology. The values are as follows: 112 * <ul> 113 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_UNKNOWN} 114 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_GSM} 115 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_1XRTT} 116 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_WCDMA} 117 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_HSPA} 118 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_HSPAP} 119 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_TD_SCDMA} 120 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_EVDO} 121 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_EHRPD} 122 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_LTE} 123 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_LTE_CA} 124 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_IWLAN} 125 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_NR} 126 * </ul> 127 * @throws { BusinessError } 201 - Permission denied. 128 * @throws { BusinessError } 401 - Parameter error. 129 * @throws { BusinessError } 8300001 - Invalid parameter value. 130 * @throws { BusinessError } 8300002 - Service connection failed. 131 * @throws { BusinessError } 8300003 - System internal error. 132 * @throws { BusinessError } 8300999 - Unknown error. 133 * @syscap SystemCapability.Telephony.CoreService 134 * @since 6 135 */ 136 /** 137 * Obtains radio access technology (RAT) of the registered network. The system 138 * returns RAT of the packet service (PS) and circuit service (CS) domain. 139 * 140 * @permission ohos.permission.GET_NETWORK_INFO 141 * @param { number } slotId - Indicates the card slot index number, 142 * ranging from 0 to the maximum card slot index number supported by the device. 143 * @returns { Promise<NetworkRadioTech> } Returns the RAT of PS domain and CS domain of registered network. 144 * The values of RAT are as follows: 145 * <ul> 146 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_UNKNOWN} 147 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_GSM} 148 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_1XRTT} 149 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_WCDMA} 150 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_HSPA} 151 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_HSPAP} 152 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_TD_SCDMA} 153 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_EVDO} 154 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_EHRPD} 155 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_LTE} 156 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_LTE_CA} 157 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_IWLAN} 158 * <li>{@code RadioTechnology#RADIO_TECHNOLOGY_NR} 159 * </ul> 160 * @throws { BusinessError } 201 - Permission denied. 161 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 162 * 2. Incorrect parameter types. 163 * @throws { BusinessError } 8300001 - Invalid parameter value. 164 * @throws { BusinessError } 8300002 - Service connection failed. 165 * @throws { BusinessError } 8300003 - System internal error. 166 * @throws { BusinessError } 8300999 - Unknown error. 167 * @syscap SystemCapability.Telephony.CoreService 168 * @since 11 169 */ 170 function getRadioTech(slotId: number): Promise<NetworkRadioTech>; 171 172 /** 173 * Obtains the network state of the registered network. 174 * 175 * @permission ohos.permission.GET_NETWORK_INFO 176 * @param { number } slotId - Indicates the card slot index number, 177 * ranging from 0 to the maximum card slot index number supported by the device. 178 * @param { AsyncCallback<NetworkState> } callback - Indicates the callback for getting network registration state. 179 * @throws { BusinessError } 201 - Permission denied. 180 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 181 * 2. Incorrect parameter types. 182 * @throws { BusinessError } 8300001 - Invalid parameter value. 183 * @throws { BusinessError } 8300002 - Service connection failed. 184 * @throws { BusinessError } 8300003 - System internal error. 185 * @throws { BusinessError } 8300999 - Unknown error. 186 * @syscap SystemCapability.Telephony.CoreService 187 * @since 6 188 */ 189 function getNetworkState(slotId: number, callback: AsyncCallback<NetworkState>): void; 190 191 /** 192 * Obtains the network state of the registered network. 193 * 194 * @permission ohos.permission.GET_NETWORK_INFO 195 * @param { number } slotId - Indicates the card slot index number, 196 * ranging from 0 to the maximum card slot index number supported by the device. 197 * @returns { Promise<NetworkState> } Returns the NetworkState object. 198 * @throws { BusinessError } 201 - Permission denied. 199 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 200 * 2. Incorrect parameter types. 201 * @throws { BusinessError } 8300001 - Invalid parameter value. 202 * @throws { BusinessError } 8300002 - Service connection failed. 203 * @throws { BusinessError } 8300003 - System internal error. 204 * @throws { BusinessError } 8300999 - Unknown error. 205 * @syscap SystemCapability.Telephony.CoreService 206 * @since 6 207 */ 208 function getNetworkState(slotId?: number): Promise<NetworkState>; 209 210 /** 211 * Obtains the network state of the registered network. 212 * 213 * @permission ohos.permission.GET_NETWORK_INFO 214 * @param { AsyncCallback<NetworkState> } callback - Indicates the callback for getting network registration state. 215 * @throws { BusinessError } 201 - Permission denied. 216 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 217 * 2. Incorrect parameter types. 218 * @throws { BusinessError } 8300001 - Invalid parameter value. 219 * @throws { BusinessError } 8300002 - Service connection failed. 220 * @throws { BusinessError } 8300003 - System internal error. 221 * @throws { BusinessError } 8300999 - Unknown error. 222 * @syscap SystemCapability.Telephony.CoreService 223 * @since 6 224 */ 225 function getNetworkState(callback: AsyncCallback<NetworkState>): void; 226 227 /** 228 * Actively requests to update location information. 229 * 230 * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION 231 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot 232 * index number supported by the device. 233 * @param { AsyncCallback<void> } callback - The callback of sendUpdateCellLocationRequest. 234 * @throws { BusinessError } 201 - Permission denied. 235 * @throws { BusinessError } 202 - Non-system applications use system APIs. 236 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 237 * 2. Incorrect parameter types. 238 * @throws { BusinessError } 8300001 - Invalid parameter value. 239 * @throws { BusinessError } 8300002 - Service connection failed. 240 * @throws { BusinessError } 8300003 - System internal error. 241 * @throws { BusinessError } 8300999 - Unknown error. 242 * @syscap SystemCapability.Telephony.CoreService 243 * @systemapi Hide this for inner system use. 244 * @since 8 245 */ 246 function sendUpdateCellLocationRequest(slotId: number, callback: AsyncCallback<void>): void; 247 248 /** 249 * Actively requests to update location information. 250 * 251 * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION 252 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot 253 * index number supported by the device. 254 * @returns { Promise<void> } The promise returned by the sendUpdateCellLocationRequest. 255 * @throws { BusinessError } 201 - Permission denied. 256 * @throws { BusinessError } 202 - Non-system applications use system APIs. 257 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 258 * 2. Incorrect parameter types. 259 * @throws { BusinessError } 8300001 - Invalid parameter value. 260 * @throws { BusinessError } 8300002 - Service connection failed. 261 * @throws { BusinessError } 8300003 - System internal error. 262 * @throws { BusinessError } 8300999 - Unknown error. 263 * @syscap SystemCapability.Telephony.CoreService 264 * @systemapi Hide this for inner system use. 265 * @since 8 266 */ 267 function sendUpdateCellLocationRequest(slotId?: number): Promise<void>; 268 269 /** 270 * Actively requests to update location information. 271 * 272 * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION 273 * @param { AsyncCallback<void> } callback - The callback of sendUpdateCellLocationRequest. 274 * @throws { BusinessError } 201 - Permission denied. 275 * @throws { BusinessError } 202 - Non-system applications use system APIs. 276 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 277 * 2. Incorrect parameter types. 278 * @throws { BusinessError } 8300001 - Invalid parameter value. 279 * @throws { BusinessError } 8300002 - Service connection failed. 280 * @throws { BusinessError } 8300003 - System internal error. 281 * @throws { BusinessError } 8300999 - Unknown error. 282 * @syscap SystemCapability.Telephony.CoreService 283 * @systemapi Hide this for inner system use. 284 * @since 8 285 */ 286 function sendUpdateCellLocationRequest(callback: AsyncCallback<void>): void; 287 288 /** 289 * Get the current cell information. 290 * 291 * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION 292 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot 293 * index number supported by the device. 294 * @param { AsyncCallback<Array<CellInformation>> } callback - Indicates the callback for getting cell information. 295 * @throws { BusinessError } 201 - Permission denied. 296 * @throws { BusinessError } 202 - Non-system applications use system APIs. 297 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 298 * 2. Incorrect parameter types. 299 * @throws { BusinessError } 8300001 - Invalid parameter value. 300 * @throws { BusinessError } 8300002 - Service connection failed. 301 * @throws { BusinessError } 8300003 - System internal error. 302 * @throws { BusinessError } 8300999 - Unknown error. 303 * @syscap SystemCapability.Telephony.CoreService 304 * @systemapi Hide this for inner system use. 305 * @since 8 306 */ 307 function getCellInformation(slotId: number, callback: AsyncCallback<Array<CellInformation>>): void; 308 309 /** 310 * Get the current cell information. 311 * 312 * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION 313 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot 314 * index number supported by the device. 315 * @returns { Promise<Array<CellInformation>> } Returns the current cell information. 316 * @throws { BusinessError } 201 - Permission denied. 317 * @throws { BusinessError } 202 - Non-system applications use system APIs. 318 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 319 * 2. Incorrect parameter types. 320 * @throws { BusinessError } 8300001 - Invalid parameter value. 321 * @throws { BusinessError } 8300002 - Service connection failed. 322 * @throws { BusinessError } 8300003 - System internal error. 323 * @throws { BusinessError } 8300999 - Unknown error. 324 * @syscap SystemCapability.Telephony.CoreService 325 * @systemapi Hide this for inner system use. 326 * @since 8 327 */ 328 function getCellInformation(slotId?: number): Promise<Array<CellInformation>>; 329 330 /** 331 * Get the current cell information. 332 * 333 * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION 334 * @param { AsyncCallback<Array<CellInformation>> } callback - Indicates the callback for getting cell information. 335 * @throws { BusinessError } 201 - Permission denied. 336 * @throws { BusinessError } 202 - Non-system applications use system APIs. 337 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 338 * 2. Incorrect parameter types. 339 * @throws { BusinessError } 8300001 - Invalid parameter value. 340 * @throws { BusinessError } 8300002 - Service connection failed. 341 * @throws { BusinessError } 8300003 - System internal error. 342 * @throws { BusinessError } 8300999 - Unknown error. 343 * @syscap SystemCapability.Telephony.CoreService 344 * @systemapi Hide this for inner system use. 345 * @since 8 346 */ 347 function getCellInformation(callback: AsyncCallback<Array<CellInformation>>): void; 348 349 /** 350 * Obtains the network search mode of the SIM card in a specified slot. 351 * 352 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot 353 * index number supported by the device. 354 * @param { AsyncCallback<NetworkSelectionMode> } callback - Indicates the callback for getting 355 * the network search mode of the SIM card. Available values are as follows: 356 * <ul> 357 * <li>{@link NetworkSelectionMode#NETWORK_SELECTION_UNKNOWN} 358 * <li>{@link NetworkSelectionMode#NETWORK_SELECTION_AUTOMATIC} 359 * <li>{@link NetworkSelectionMode#NETWORK_SELECTION_MANUAL} 360 * <ul> 361 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 362 * 2. Incorrect parameter types. 363 * @throws { BusinessError } 8300001 - Invalid parameter value. 364 * @throws { BusinessError } 8300002 - Service connection failed. 365 * @throws { BusinessError } 8300003 - System internal error. 366 * @throws { BusinessError } 8300999 - Unknown error. 367 * @syscap SystemCapability.Telephony.CoreService 368 * @since 6 369 */ 370 function getNetworkSelectionMode(slotId: number, callback: AsyncCallback<NetworkSelectionMode>): void; 371 372 /** 373 * Obtains the network search mode of the SIM card in a specified slot. 374 * 375 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot 376 * index number supported by the device. 377 * @returns { Promise<NetworkSelectionMode> } Returns the network search mode of the SIM card. 378 * Available values are as follows: 379 * <ul> 380 * <li>{@link NetworkSelectionMode#NETWORK_SELECTION_UNKNOWN} 381 * <li>{@link NetworkSelectionMode#NETWORK_SELECTION_AUTOMATIC} 382 * <li>{@link NetworkSelectionMode#NETWORK_SELECTION_MANUAL} 383 * <ul> 384 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 385 * 2. Incorrect parameter types. 386 * @throws { BusinessError } 8300001 - Invalid parameter value. 387 * @throws { BusinessError } 8300002 - Service connection failed. 388 * @throws { BusinessError } 8300003 - System internal error. 389 * @throws { BusinessError } 8300999 - Unknown error. 390 * @syscap SystemCapability.Telephony.CoreService 391 * @since 6 392 */ 393 function getNetworkSelectionMode(slotId: number): Promise<NetworkSelectionMode>; 394 395 /** 396 * Set the current network selection mode. 397 * 398 * @permission ohos.permission.SET_TELEPHONY_STATE 399 * @param { NetworkSelectionModeOptions } options Indicates the network selection mode option. 400 * @param { AsyncCallback<void> } callback - The callback of setNetworkSelectionMode. 401 * @throws { BusinessError } 201 - Permission denied. 402 * @throws { BusinessError } 202 - Non-system applications use system APIs. 403 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 404 * 2. Incorrect parameter types. 405 * @throws { BusinessError } 8300001 - Invalid parameter value. 406 * @throws { BusinessError } 8300002 - Service connection failed. 407 * @throws { BusinessError } 8300003 - System internal error. 408 * @throws { BusinessError } 8300999 - Unknown error. 409 * @syscap SystemCapability.Telephony.CoreService 410 * @systemapi Hide this for inner system use. 411 * @since 6 412 */ 413 function setNetworkSelectionMode(options: NetworkSelectionModeOptions, callback: AsyncCallback<void>): void; 414 415 /** 416 * Set the current network selection mode. 417 * 418 * @permission ohos.permission.SET_TELEPHONY_STATE 419 * @param { NetworkSelectionModeOptions } options Indicates the network selection mode option. 420 * @returns { Promise<void> } The promise returned by the setNetworkSelectionMode. 421 * @throws { BusinessError } 201 - Permission denied. 422 * @throws { BusinessError } 202 - Non-system applications use system APIs. 423 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 424 * 2. Incorrect parameter types. 425 * @throws { BusinessError } 8300001 - Invalid parameter value. 426 * @throws { BusinessError } 8300002 - Service connection failed. 427 * @throws { BusinessError } 8300003 - System internal error. 428 * @throws { BusinessError } 8300999 - Unknown error. 429 * @syscap SystemCapability.Telephony.CoreService 430 * @systemapi Hide this for inner system use. 431 * @since 6 432 */ 433 function setNetworkSelectionMode(options: NetworkSelectionModeOptions): Promise<void>; 434 435 /** 436 * Get network search information. 437 * 438 * @permission ohos.permission.GET_TELEPHONY_STATE 439 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot 440 * index number supported by the device. 441 * @param { AsyncCallback<NetworkSearchResult> } callback - Indicates the callback for getting 442 * the search results of the network. 443 * @throws { BusinessError } 201 - Permission denied. 444 * @throws { BusinessError } 202 - Non-system applications use system APIs. 445 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 446 * 2. Incorrect parameter types. 447 * @throws { BusinessError } 8300001 - Invalid parameter value. 448 * @throws { BusinessError } 8300002 - Service connection failed. 449 * @throws { BusinessError } 8300003 - System internal error. 450 * @throws { BusinessError } 8300999 - Unknown error. 451 * @syscap SystemCapability.Telephony.CoreService 452 * @systemapi Hide this for inner system use. 453 * @since 6 454 */ 455 function getNetworkSearchInformation(slotId: number, callback: AsyncCallback<NetworkSearchResult>): void; 456 457 /** 458 * Get network search information. 459 * 460 * @permission ohos.permission.GET_TELEPHONY_STATE 461 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot 462 * index number supported by the device. 463 * @returns { Promise<NetworkSearchResult> } Returns the search results of the network. 464 * @throws { BusinessError } 201 - Permission denied. 465 * @throws { BusinessError } 202 - Non-system applications use system APIs. 466 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 467 * 2. Incorrect parameter types. 468 * @throws { BusinessError } 8300001 - Invalid parameter value. 469 * @throws { BusinessError } 8300002 - Service connection failed. 470 * @throws { BusinessError } 8300003 - System internal error. 471 * @throws { BusinessError } 8300999 - Unknown error. 472 * @syscap SystemCapability.Telephony.CoreService 473 * @systemapi Hide this for inner system use. 474 * @since 6 475 */ 476 function getNetworkSearchInformation(slotId: number): Promise<NetworkSearchResult>; 477 478 /** 479 * Obtains the ISO-defined country code of the country where the registered network is deployed. 480 * 481 * @param { number } slotId - Indicates the card slot index number, 482 * ranging from 0 to the maximum card slot index number supported by the device. 483 * @param { AsyncCallback<string> } callback - Indicates the callback for getting the country code 484 * defined in ISO 3166-2; returns an empty string if the device is not registered with any network. 485 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 486 * 2. Incorrect parameter types. 487 * @throws { BusinessError } 8300001 - Invalid parameter value. 488 * @throws { BusinessError } 8300002 - Service connection failed. 489 * @throws { BusinessError } 8300003 - System internal error. 490 * @throws { BusinessError } 8300999 - Unknown error. 491 * @syscap SystemCapability.Telephony.CoreService 492 * @since 7 493 */ 494 function getISOCountryCodeForNetwork(slotId: number, callback: AsyncCallback<string>): void; 495 496 /** 497 * Obtains the ISO-defined country code of the country where the registered network is deployed. 498 * 499 * @param { number } slotId - Indicates the card slot index number, 500 * ranging from 0 to the maximum card slot index number supported by the device. 501 * @returns { Promise<string> } Returns the country code defined in ISO 3166-2. 502 * Returns an empty string if the device is not registered with any network. 503 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 504 * 2. Incorrect parameter types. 505 * @throws { BusinessError } 8300001 - Invalid parameter value. 506 * @throws { BusinessError } 8300002 - Service connection failed. 507 * @throws { BusinessError } 8300003 - System internal error. 508 * @throws { BusinessError } 8300999 - Unknown error. 509 * @syscap SystemCapability.Telephony.CoreService 510 * @since 7 511 */ 512 function getISOCountryCodeForNetwork(slotId: number): Promise<string>; 513 514 /** 515 * Obtains the ISO-defined country code of the country where the registered network is deployed. 516 * 517 * @param { number } slotId - Indicates the card slot index number, 518 * ranging from 0 to the maximum card slots supported by the device. 519 * @returns { string } Returns the country code defined in ISO 3166-2. 520 * Returns an empty string if the device is not registered with any network. 521 * @syscap SystemCapability.Telephony.CoreService 522 * @since 10 523 */ 524 function getISOCountryCodeForNetworkSync(slotId: number): string; 525 526 /** 527 * Get the option mode of NR. 528 * 529 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot 530 * index number supported by the device. 531 * @param { AsyncCallback<NrOptionMode> } callback - Indicates the callback for getting the selection mode of NR. 532 * @throws { BusinessError } 202 - Non-system applications use system APIs. 533 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 534 * 2. Incorrect parameter types. 535 * @throws { BusinessError } 8300001 - Invalid parameter value. 536 * @throws { BusinessError } 8300002 - Service connection failed. 537 * @throws { BusinessError } 8300003 - System internal error. 538 * @throws { BusinessError } 8300999 - Unknown error. 539 * @syscap SystemCapability.Telephony.CoreService 540 * @systemapi Hide this for inner system use. 541 * @since 8 542 * @deprecated since 10 543 * @useinstead telephony.radio#getNROptionMode 544 */ 545 function getNrOptionMode(slotId: number, callback: AsyncCallback<NrOptionMode>): void; 546 547 /** 548 * Get the option mode of NR. 549 * 550 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot 551 * index number supported by the device. 552 * @returns { Promise<NrOptionMode> } Returns the selection mode of NR. 553 * @throws { BusinessError } 202 - Non-system applications use system APIs. 554 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 555 * 2. Incorrect parameter types. 556 * @throws { BusinessError } 8300001 - Invalid parameter value. 557 * @throws { BusinessError } 8300002 - Service connection failed. 558 * @throws { BusinessError } 8300003 - System internal error. 559 * @throws { BusinessError } 8300999 - Unknown error. 560 * @syscap SystemCapability.Telephony.CoreService 561 * @systemapi Hide this for inner system use. 562 * @since 8 563 * @deprecated since 10 564 * @useinstead telephony.radio#getNROptionMode 565 */ 566 function getNrOptionMode(slotId?: number): Promise<NrOptionMode>; 567 568 /** 569 * Get the option mode of NR. 570 * 571 * @param { AsyncCallback<NrOptionMode> } callback - Indicates the callback for getting the selection mode of NR. 572 * @throws { BusinessError } 202 - Non-system applications use system APIs. 573 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 574 * 2. Incorrect parameter types. 575 * @throws { BusinessError } 8300001 - Invalid parameter value. 576 * @throws { BusinessError } 8300002 - Service connection failed. 577 * @throws { BusinessError } 8300003 - System internal error. 578 * @throws { BusinessError } 8300999 - Unknown error. 579 * @syscap SystemCapability.Telephony.CoreService 580 * @systemapi Hide this for inner system use. 581 * @since 8 582 * @deprecated since 10 583 * @useinstead telephony.radio#getNROptionMode 584 */ 585 function getNrOptionMode(callback: AsyncCallback<NrOptionMode>): void; 586 587 /** 588 * Obtains the IMEI of a specified card slot of the device. 589 * 590 * @permission ohos.permission.GET_TELEPHONY_STATE 591 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot 592 * index number supported by the device. 593 * @param { AsyncCallback<string> } callback - Indicates the callback for getting the IMEI. 594 * Returns an empty string if the IMEI does not exist. 595 * @throws { BusinessError } 201 - Permission denied. 596 * @throws { BusinessError } 202 - Non-system applications use system APIs. 597 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 598 * 2. Incorrect parameter types. 599 * @throws { BusinessError } 8300001 - Invalid parameter value. 600 * @throws { BusinessError } 8300002 - Service connection failed. 601 * @throws { BusinessError } 8300003 - System internal error. 602 * @throws { BusinessError } 8300999 - Unknown error. 603 * @syscap SystemCapability.Telephony.CoreService 604 * @systemapi Hide this for inner system use. 605 * @since 8 606 */ 607 function getIMEI(slotId: number, callback: AsyncCallback<string>): void; 608 609 /** 610 * Obtains the IMEI of a specified card slot of the device. 611 * 612 * @permission ohos.permission.GET_TELEPHONY_STATE 613 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot 614 * index number supported by the device. 615 * @returns { Promise<string> } Returns the IMEI. Returns an empty string if the IMEI does not exist. 616 * @throws { BusinessError } 201 - Permission denied. 617 * @throws { BusinessError } 202 - Non-system applications use system APIs. 618 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 619 * 2. Incorrect parameter types. 620 * @throws { BusinessError } 8300001 - Invalid parameter value. 621 * @throws { BusinessError } 8300002 - Service connection failed. 622 * @throws { BusinessError } 8300003 - System internal error. 623 * @throws { BusinessError } 8300999 - Unknown error. 624 * @syscap SystemCapability.Telephony.CoreService 625 * @systemapi Hide this for inner system use. 626 * @since 8 627 */ 628 function getIMEI(slotId?: number): Promise<string>; 629 630 /** 631 * Obtains the IMEI of a specified card slot of the device. 632 * 633 * @permission ohos.permission.GET_TELEPHONY_STATE 634 * @param { AsyncCallback<string> } callback - Indicates the callback for getting the IMEI. 635 * Returns an empty string if the IMEI does not exist. 636 * @throws { BusinessError } 201 - Permission denied. 637 * @throws { BusinessError } 202 - Non-system applications use system APIs. 638 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 639 * 2. Incorrect parameter types. 640 * @throws { BusinessError } 8300001 - Invalid parameter value. 641 * @throws { BusinessError } 8300002 - Service connection failed. 642 * @throws { BusinessError } 8300003 - System internal error. 643 * @throws { BusinessError } 8300999 - Unknown error. 644 * @syscap SystemCapability.Telephony.CoreService 645 * @systemapi Hide this for inner system use. 646 * @since 8 647 */ 648 function getIMEI(callback: AsyncCallback<string>): void; 649 650 /** 651 * Obtains the MEID of a specified card slot of the device. 652 * 653 * @permission ohos.permission.GET_TELEPHONY_STATE 654 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot 655 * index number supported by the device. 656 * @param { AsyncCallback<string> } callback - Indicates the callback for getting the MEID. 657 * Returns an empty string if the MEID does not exist. 658 * @throws { BusinessError } 201 - Permission denied. 659 * @throws { BusinessError } 202 - Non-system applications use system APIs. 660 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 661 * 2. Incorrect parameter types. 662 * @throws { BusinessError } 8300001 - Invalid parameter value. 663 * @throws { BusinessError } 8300002 - Service connection failed. 664 * @throws { BusinessError } 8300003 - System internal error. 665 * @throws { BusinessError } 8300999 - Unknown error. 666 * @syscap SystemCapability.Telephony.CoreService 667 * @systemapi Hide this for inner system use. 668 * @since 8 669 */ 670 function getMEID(slotId: number, callback: AsyncCallback<string>): void; 671 672 /** 673 * Obtains the MEID of a specified card slot of the device. 674 * 675 * @permission ohos.permission.GET_TELEPHONY_STATE 676 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot 677 * index number supported by the device. 678 * @returns { Promise<string> } Returns the MEID. Returns an empty string if the MEID does not exist. 679 * @throws { BusinessError } 201 - Permission denied. 680 * @throws { BusinessError } 202 - Non-system applications use system APIs. 681 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 682 * 2. Incorrect parameter types. 683 * @throws { BusinessError } 8300001 - Invalid parameter value. 684 * @throws { BusinessError } 8300002 - Service connection failed. 685 * @throws { BusinessError } 8300003 - System internal error. 686 * @throws { BusinessError } 8300999 - Unknown error. 687 * @syscap SystemCapability.Telephony.CoreService 688 * @systemapi Hide this for inner system use. 689 * @since 8 690 */ 691 function getMEID(slotId?: number): Promise<string>; 692 693 /** 694 * Obtains the MEID of a specified card slot of the device. 695 * 696 * @permission ohos.permission.GET_TELEPHONY_STATE 697 * @param { AsyncCallback<string> } callback - Indicates the callback for getting the MEID. 698 * Returns an empty string if the MEID does not exist. 699 * @throws { BusinessError } 201 - Permission denied. 700 * @throws { BusinessError } 202 - Non-system applications use system APIs. 701 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 702 * 2. Incorrect parameter types. 703 * @throws { BusinessError } 8300001 - Invalid parameter value. 704 * @throws { BusinessError } 8300002 - Service connection failed. 705 * @throws { BusinessError } 8300003 - System internal error. 706 * @throws { BusinessError } 8300999 - Unknown error. 707 * @syscap SystemCapability.Telephony.CoreService 708 * @systemapi Hide this for inner system use. 709 * @since 8 710 */ 711 function getMEID(callback: AsyncCallback<string>): void; 712 713 /** 714 * Obtains the unique device ID of a specified card slot of the device. 715 * 716 * If the device is registered with a 3GPP-compliant network, the international mobile equipment identity 717 * (IMEI) is returned. If the device is registered with a 3GPP2-compliant network, the mobile equipment identifier 718 * (MEID) is returned. 719 * 720 * @permission ohos.permission.GET_TELEPHONY_STATE 721 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot 722 * index number supported by the device. 723 * @param { AsyncCallback<string> } callback - Indicates the callback for getting the unique device ID. 724 * Returns an empty string if the unique device ID does not exist. 725 * @throws { BusinessError } 201 - Permission denied. 726 * @throws { BusinessError } 202 - Non-system applications use system APIs. 727 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 728 * 2. Incorrect parameter types. 729 * @throws { BusinessError } 8300001 - Invalid parameter value. 730 * @throws { BusinessError } 8300002 - Service connection failed. 731 * @throws { BusinessError } 8300003 - System internal error. 732 * @throws { BusinessError } 8300999 - Unknown error. 733 * @syscap SystemCapability.Telephony.CoreService 734 * @systemapi Hide this for inner system use. 735 * @since 8 736 */ 737 function getUniqueDeviceId(slotId: number, callback: AsyncCallback<string>): void; 738 739 /** 740 * Obtains the unique device ID of a specified card slot of the device. 741 * 742 * If the device is registered with a 3GPP-compliant network, the international mobile equipment identity 743 * (IMEI) is returned. If the device is registered with a 3GPP2-compliant network, the mobile equipment identifier 744 * (MEID) is returned. 745 * 746 * @permission ohos.permission.GET_TELEPHONY_STATE 747 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot 748 * index number supported by the device. 749 * @returns { Promise<string> } Returns the unique device ID. 750 * Returns an empty string if the unique device ID does not exist. 751 * @throws { BusinessError } 201 - Permission denied. 752 * @throws { BusinessError } 202 - Non-system applications use system APIs. 753 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 754 * 2. Incorrect parameter types. 755 * @throws { BusinessError } 8300001 - Invalid parameter value. 756 * @throws { BusinessError } 8300002 - Service connection failed. 757 * @throws { BusinessError } 8300003 - System internal error. 758 * @throws { BusinessError } 8300999 - Unknown error. 759 * @syscap SystemCapability.Telephony.CoreService 760 * @systemapi Hide this for inner system use. 761 * @since 8 762 */ 763 function getUniqueDeviceId(slotId?: number): Promise<string>; 764 765 /** 766 * Obtains the unique device ID of a specified card slot of the device. 767 * 768 * If the device is registered with a 3GPP-compliant network, the international mobile equipment identity 769 * (IMEI) is returned. If the device is registered with a 3GPP2-compliant network, the mobile equipment identifier 770 * (MEID) is returned. 771 * 772 * @permission ohos.permission.GET_TELEPHONY_STATE 773 * @param { AsyncCallback<string> } callback - Indicates the callback for getting the unique device ID. 774 * Returns an empty string if the unique device ID does not exist. 775 * @throws { BusinessError } 201 - Permission denied. 776 * @throws { BusinessError } 202 - Non-system applications use system APIs. 777 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 778 * 2. Incorrect parameter types. 779 * @throws { BusinessError } 8300001 - Invalid parameter value. 780 * @throws { BusinessError } 8300002 - Service connection failed. 781 * @throws { BusinessError } 8300003 - System internal error. 782 * @throws { BusinessError } 8300999 - Unknown error. 783 * @syscap SystemCapability.Telephony.CoreService 784 * @systemapi Hide this for inner system use. 785 * @since 8 786 */ 787 function getUniqueDeviceId(callback: AsyncCallback<string>): void; 788 789 /** 790 * Obtains the index number of the card slot where the primary card is located if multiple SIM cards are inserted. 791 * 792 * The primary card is the SIM card inserted in the card slot that uses data services by default. 793 * 794 * @param { AsyncCallback<number> } callback - Indicates the callback for getting the index number of 795 * the primary card slot. 796 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 797 * 2. Incorrect parameter types. 798 * @throws { BusinessError } 8300001 - Invalid parameter value. 799 * @throws { BusinessError } 8300002 - Service connection failed. 800 * @throws { BusinessError } 8300003 - System internal error. 801 * @throws { BusinessError } 8300999 - Unknown error. 802 * @syscap SystemCapability.Telephony.CoreService 803 * @since 7 804 */ 805 function getPrimarySlotId(callback: AsyncCallback<number>): void; 806 807 /** 808 * Obtains the index number of the card slot where the primary card is located if multiple SIM cards are inserted. 809 * 810 * The primary card is the SIM card inserted in the card slot that uses data services by default. 811 * 812 * @returns { Promise<number> } Returns the index number of the primary card slot. 813 * @throws { BusinessError } 8300002 - Service connection failed. 814 * @throws { BusinessError } 8300003 - System internal error. 815 * @throws { BusinessError } 8300999 - Unknown error. 816 * @syscap SystemCapability.Telephony.CoreService 817 * @since 7 818 */ 819 function getPrimarySlotId(): Promise<number>; 820 821 /** 822 * Set the index number of the main SIM card slot. 823 * 824 * @permission ohos.permission.SET_TELEPHONY_STATE 825 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot 826 * index number supported by the device. 827 * @param { AsyncCallback<void> } callback - The callback of setPrimarySlotId. 828 * @throws { BusinessError } 201 - Permission denied. 829 * @throws { BusinessError } 202 - Non-system applications use system APIs. 830 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 831 * 2. Incorrect parameter types. 832 * @throws { BusinessError } 8300001 - Invalid parameter value. 833 * @throws { BusinessError } 8300002 - Service connection failed. 834 * @throws { BusinessError } 8300003 - System internal error. 835 * @throws { BusinessError } 8300004 - No SIM card found. 836 * @throws { BusinessError } 8300999 - Unknown error. 837 * @syscap SystemCapability.Telephony.CoreService 838 * @systemapi Hide this for inner system use. 839 * @since 8 840 */ 841 function setPrimarySlotId(slotId: number, callback: AsyncCallback<void>): void; 842 843 /** 844 * Set the index number of the main SIM card slot. 845 * 846 * @permission ohos.permission.SET_TELEPHONY_STATE 847 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot 848 * index number supported by the device. 849 * @returns { Promise<void> } The promise returned by the setPrimarySlotId. 850 * @throws { BusinessError } 201 - Permission denied. 851 * @throws { BusinessError } 202 - Non-system applications use system APIs. 852 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 853 * 2. Incorrect parameter types. 854 * @throws { BusinessError } 8300001 - Invalid parameter value. 855 * @throws { BusinessError } 8300002 - Service connection failed. 856 * @throws { BusinessError } 8300003 - System internal error. 857 * @throws { BusinessError } 8300004 - No SIM card found. 858 * @throws { BusinessError } 8300999 - Unknown error. 859 * @syscap SystemCapability.Telephony.CoreService 860 * @systemapi Hide this for inner system use. 861 * @since 8 862 */ 863 function setPrimarySlotId(slotId: number): Promise<void>; 864 865 /** 866 * Obtains the list of signal strength information of the registered network corresponding to a specified SIM card. 867 * 868 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot 869 * index number supported by the device. 870 * @param { AsyncCallback<Array<SignalInformation>> } callback - Indicates the callback for getting 871 * the instance list of the child classes derived from {@link SignalInformation}. 872 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 873 * 2. Incorrect parameter types. 874 * @throws { BusinessError } 8300001 - Invalid parameter value. 875 * @throws { BusinessError } 8300002 - Service connection failed. 876 * @throws { BusinessError } 8300003 - System internal error. 877 * @throws { BusinessError } 8300999 - Unknown error. 878 * @syscap SystemCapability.Telephony.CoreService 879 * @since 7 880 */ 881 function getSignalInformation(slotId: number, callback: AsyncCallback<Array<SignalInformation>>): void; 882 883 /** 884 * Obtains the list of signal strength information of the registered network corresponding to a specified SIM card. 885 * 886 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot 887 * index number supported by the device. 888 * @returns { Promise<Array<SignalInformation>> } Returns the callback for getting the instance list of 889 * the child classes derived from {@link SignalInformation}. 890 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 891 * 2. Incorrect parameter types. 892 * @throws { BusinessError } 8300001 - Invalid parameter value. 893 * @throws { BusinessError } 8300002 - Service connection failed. 894 * @throws { BusinessError } 8300003 - System internal error. 895 * @throws { BusinessError } 8300999 - Unknown error. 896 * @syscap SystemCapability.Telephony.CoreService 897 * @since 7 898 */ 899 function getSignalInformation(slotId: number): Promise<Array<SignalInformation>>; 900 901 /** 902 * Obtains the list of signal strength information of the registered network corresponding to a specified SIM card. 903 * 904 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum 905 * card slots supported by the device. 906 * @returns { Array<SignalInformation> } Returns the callback for getting the instance list of 907 * the child classes derived from {@link SignalInformation}. 908 * @syscap SystemCapability.Telephony.CoreService 909 * @since 10 910 */ 911 function getSignalInformationSync(slotId: number): Array<SignalInformation>; 912 913 /** 914 * Checks whether the device supports 5G New Radio (NR). 915 * 916 * @returns { boolean } Returns {@code true} if the device supports 5G NR; returns {@code false} otherwise. 917 * @syscap SystemCapability.Telephony.CoreService 918 * @since 7 919 * @deprecated since 9 920 * @useinstead telephony.radio#isNRSupported 921 */ 922 function isNrSupported(): boolean; 923 924 /** 925 * Checks whether the device supports 5G New Radio (NR) by according card slot. 926 * 927 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot 928 * index number supported by the device. 929 * @returns { boolean } Returns {@code true} if the device supports 5G NR; returns {@code false} otherwise. 930 * @syscap SystemCapability.Telephony.CoreService 931 * @since 8 932 * @deprecated since 9 933 * @useinstead telephony.radio#isNRSupported 934 */ 935 function isNrSupported(slotId: number): boolean; 936 937 /** 938 * Checks whether the device supports 5G New Radio (NR). 939 * 940 * @returns { boolean } Returns {@code true} if the device supports 5G NR; returns {@code false} otherwise. 941 * @syscap SystemCapability.Telephony.CoreService 942 * @since 9 943 */ 944 function isNRSupported(): boolean; 945 946 /** 947 * Checks whether the device supports 5G New Radio (NR) by according card slot. 948 * 949 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot 950 * index number supported by the device. 951 * @returns { boolean } Returns {@code true} if the device supports 5G NR; returns {@code false} otherwise. 952 * @syscap SystemCapability.Telephony.CoreService 953 * @since 9 954 */ 955 function isNRSupported(slotId: number): boolean; 956 957 /** 958 * Checks whether the radio service is enabled. 959 * 960 * @permission ohos.permission.GET_NETWORK_INFO 961 * @param { number } slotId - Indicates the card slot index number, 962 * ranging from 0 to the maximum card slot index number supported by the device. 963 * @param { AsyncCallback<boolean> } callback - Returns {@code true} If the radio service is enabled. 964 * Returns {@code false} otherwise. 965 * @throws { BusinessError } 201 - Permission denied. 966 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 967 * 2. Incorrect parameter types. 968 * @throws { BusinessError } 8300001 - Invalid parameter value. 969 * @throws { BusinessError } 8300002 - Service connection failed. 970 * @throws { BusinessError } 8300003 - System internal error. 971 * @throws { BusinessError } 8300999 - Unknown error. 972 * @syscap SystemCapability.Telephony.CoreService 973 * @since 7 974 */ 975 function isRadioOn(slotId: number, callback: AsyncCallback<boolean>): void; 976 977 /** 978 * Checks whether the radio service is enabled. 979 * 980 * @permission ohos.permission.GET_NETWORK_INFO 981 * @param { number } slotId - Indicates the card slot index number, 982 * ranging from 0 to the maximum card slot index number supported by the device. 983 * @returns { Promise<boolean> } Returns {@code true} If the radio service is enabled; returns {@code false} otherwise. 984 * @throws { BusinessError } 201 - Permission denied. 985 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 986 * 2. Incorrect parameter types. 987 * @throws { BusinessError } 8300001 - Invalid parameter value. 988 * @throws { BusinessError } 8300002 - Service connection failed. 989 * @throws { BusinessError } 8300003 - System internal error. 990 * @throws { BusinessError } 8300999 - Unknown error. 991 * @syscap SystemCapability.Telephony.CoreService 992 * @since 7 993 */ 994 function isRadioOn(slotId?: number): Promise<boolean>; 995 996 /** 997 * Checks whether the radio service is enabled. 998 * 999 * @permission ohos.permission.GET_NETWORK_INFO 1000 * @param { AsyncCallback<boolean> } callback - Returns {@code true} If the radio service is enabled. 1001 * Returns {@code false} otherwise. 1002 * @throws { BusinessError } 201 - Permission denied. 1003 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1004 * 2. Incorrect parameter types. 1005 * @throws { BusinessError } 8300001 - Invalid parameter value. 1006 * @throws { BusinessError } 8300002 - Service connection failed. 1007 * @throws { BusinessError } 8300003 - System internal error. 1008 * @throws { BusinessError } 8300999 - Unknown error. 1009 * @syscap SystemCapability.Telephony.CoreService 1010 * @since 7 1011 */ 1012 function isRadioOn(callback: AsyncCallback<boolean>): void; 1013 1014 /** 1015 * Turn on the radio service. 1016 * 1017 * @permission ohos.permission.SET_TELEPHONY_STATE 1018 * @param { number } slotId - Indicates the card slot index number, 1019 * ranging from 0 to the maximum card slot index number supported by the device. 1020 * @param { AsyncCallback<void> } callback - The callback of turnOnRadio. 1021 * @throws { BusinessError } 201 - Permission denied. 1022 * @throws { BusinessError } 202 - Non-system applications use system APIs. 1023 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1024 * 2. Incorrect parameter types. 1025 * @throws { BusinessError } 8300001 - Invalid parameter value. 1026 * @throws { BusinessError } 8300002 - Service connection failed. 1027 * @throws { BusinessError } 8300003 - System internal error. 1028 * @throws { BusinessError } 8300999 - Unknown error. 1029 * @syscap SystemCapability.Telephony.CoreService 1030 * @systemapi Hide this for inner system use. 1031 * @since 7 1032 */ 1033 function turnOnRadio(slotId: number, callback: AsyncCallback<void>): void; 1034 1035 /** 1036 * Turn on the radio service. 1037 * 1038 * @permission ohos.permission.SET_TELEPHONY_STATE 1039 * @param { number } slotId - Indicates the card slot index number, 1040 * ranging from 0 to the maximum card slot index number supported by the device. 1041 * @returns { Promise<void> } The promise returned by the turnOnRadio. 1042 * @throws { BusinessError } 201 - Permission denied. 1043 * @throws { BusinessError } 202 - Non-system applications use system APIs. 1044 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1045 * 2. Incorrect parameter types. 1046 * @throws { BusinessError } 8300001 - Invalid parameter value. 1047 * @throws { BusinessError } 8300002 - Service connection failed. 1048 * @throws { BusinessError } 8300003 - System internal error. 1049 * @throws { BusinessError } 8300999 - Unknown error. 1050 * @syscap SystemCapability.Telephony.CoreService 1051 * @systemapi Hide this for inner system use. 1052 * @since 7 1053 */ 1054 function turnOnRadio(slotId?: number): Promise<void>; 1055 1056 /** 1057 * Turn on the radio service. 1058 * 1059 * @permission ohos.permission.SET_TELEPHONY_STATE 1060 * @param { AsyncCallback<void> } callback - The callback of turnOnRadio. 1061 * @throws { BusinessError } 201 - Permission denied. 1062 * @throws { BusinessError } 202 - Non-system applications use system APIs. 1063 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1064 * 2. Incorrect parameter types. 1065 * @throws { BusinessError } 8300001 - Invalid parameter value. 1066 * @throws { BusinessError } 8300002 - Service connection failed. 1067 * @throws { BusinessError } 8300003 - System internal error. 1068 * @throws { BusinessError } 8300999 - Unknown error. 1069 * @syscap SystemCapability.Telephony.CoreService 1070 * @systemapi Hide this for inner system use. 1071 * @since 7 1072 */ 1073 function turnOnRadio(callback: AsyncCallback<void>): void; 1074 1075 /** 1076 * Turn off the radio service. 1077 * 1078 * @permission ohos.permission.SET_TELEPHONY_STATE 1079 * @param { number } slotId - Indicates the card slot index number, 1080 * ranging from 0 to the maximum card slot index number supported by the device. 1081 * @param { AsyncCallback<void> } callback - The callback of turnOffRadio. 1082 * @throws { BusinessError } 201 - Permission denied. 1083 * @throws { BusinessError } 202 - Non-system applications use system APIs. 1084 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1085 * 2. Incorrect parameter types. 1086 * @throws { BusinessError } 8300001 - Invalid parameter value. 1087 * @throws { BusinessError } 8300002 - Service connection failed. 1088 * @throws { BusinessError } 8300003 - System internal error. 1089 * @throws { BusinessError } 8300999 - Unknown error. 1090 * @syscap SystemCapability.Telephony.CoreService 1091 * @systemapi Hide this for inner system use. 1092 * @since 7 1093 */ 1094 function turnOffRadio(slotId: number, callback: AsyncCallback<void>): void; 1095 1096 /** 1097 * Turn off the radio service. 1098 * 1099 * @permission ohos.permission.SET_TELEPHONY_STATE 1100 * @param { number } slotId - Indicates the card slot index number, 1101 * ranging from 0 to the maximum card slot index number supported by the device. 1102 * @returns { Promise<void> } The promise returned by the turnOffRadio. 1103 * @throws { BusinessError } 201 - Permission denied. 1104 * @throws { BusinessError } 202 - Non-system applications use system APIs. 1105 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1106 * 2. Incorrect parameter types. 1107 * @throws { BusinessError } 8300001 - Invalid parameter value. 1108 * @throws { BusinessError } 8300002 - Service connection failed. 1109 * @throws { BusinessError } 8300003 - System internal error. 1110 * @throws { BusinessError } 8300999 - Unknown error. 1111 * @syscap SystemCapability.Telephony.CoreService 1112 * @systemapi Hide this for inner system use. 1113 * @since 7 1114 */ 1115 function turnOffRadio(slotId?: number): Promise<void>; 1116 1117 /** 1118 * Turn off the radio service. 1119 * 1120 * @permission ohos.permission.SET_TELEPHONY_STATE 1121 * @param { AsyncCallback<void> } callback - The callback of turnOffRadio. 1122 * @throws { BusinessError } 201 - Permission denied. 1123 * @throws { BusinessError } 202 - Non-system applications use system APIs. 1124 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1125 * 2. Incorrect parameter types. 1126 * @throws { BusinessError } 8300001 - Invalid parameter value. 1127 * @throws { BusinessError } 8300002 - Service connection failed. 1128 * @throws { BusinessError } 8300003 - System internal error. 1129 * @throws { BusinessError } 8300999 - Unknown error. 1130 * @syscap SystemCapability.Telephony.CoreService 1131 * @systemapi Hide this for inner system use. 1132 * @since 7 1133 */ 1134 function turnOffRadio(callback: AsyncCallback<void>): void; 1135 1136 /** 1137 * Get the operator name of the specified SIM card slot. 1138 * 1139 * @param { number } slotId - Indicates the card slot index number, 1140 * ranging from 0 to the maximum card slot index number supported by the device. 1141 * @param { AsyncCallback<string> } callback - Indicates the callback for getting the operator name. 1142 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1143 * 2. Incorrect parameter types. 1144 * @throws { BusinessError } 8300001 - Invalid parameter value. 1145 * @throws { BusinessError } 8300002 - Service connection failed. 1146 * @throws { BusinessError } 8300003 - System internal error. 1147 * @throws { BusinessError } 8300999 - Unknown error. 1148 * @syscap SystemCapability.Telephony.CoreService 1149 * @since 7 1150 */ 1151 function getOperatorName(slotId: number, callback: AsyncCallback<string>): void; 1152 1153 /** 1154 * Get the operator name of the specified SIM card slot. 1155 * 1156 * @param { number } slotId - Indicates the card slot index number, 1157 * ranging from 0 to the maximum card slot index number supported by the device. 1158 * @returns { Promise<string> } Returns the operator name. 1159 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1160 * 2. Incorrect parameter types. 1161 * @throws { BusinessError } 8300001 - Invalid parameter value. 1162 * @throws { BusinessError } 8300002 - Service connection failed. 1163 * @throws { BusinessError } 8300003 - System internal error. 1164 * @throws { BusinessError } 8300999 - Unknown error. 1165 * @syscap SystemCapability.Telephony.CoreService 1166 * @since 7 1167 */ 1168 function getOperatorName(slotId: number): Promise<string>; 1169 1170 /** 1171 * Get the operator name of the specified SIM card slot. 1172 * 1173 * @param { number } slotId - Indicates the card slot index number, 1174 * ranging from 0 to the maximum card slot index number supported by the device. 1175 * @returns { string } Returns the operator name. 1176 * @syscap SystemCapability.Telephony.CoreService 1177 * @since 10 1178 */ 1179 function getOperatorNameSync(slotId: number): string; 1180 1181 /** 1182 * Set the preferred network for the specified SIM card slot. 1183 * 1184 * @permission ohos.permission.SET_TELEPHONY_STATE 1185 * @param { number } slotId - Indicates the card slot index number, 1186 * ranging from 0 to the maximum card slot index number supported by the device. 1187 * @param { PreferredNetworkMode } networkMode - Indicates that you want to set the preferred network mode. 1188 * @param { AsyncCallback<void> } callback - The callback of setPreferredNetwork. 1189 * @throws { BusinessError } 201 - Permission denied. 1190 * @throws { BusinessError } 202 - Non-system applications use system APIs. 1191 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1192 * 2. Incorrect parameter types. 1193 * @throws { BusinessError } 8300001 - Invalid parameter value. 1194 * @throws { BusinessError } 8300002 - Service connection failed. 1195 * @throws { BusinessError } 8300003 - System internal error. 1196 * @throws { BusinessError } 8300999 - Unknown error. 1197 * @syscap SystemCapability.Telephony.CoreService 1198 * @systemapi Hide this for inner system use. 1199 * @since 8 1200 */ 1201 function setPreferredNetwork(slotId: number, networkMode: PreferredNetworkMode, callback: AsyncCallback<void>): void; 1202 1203 /** 1204 * Set the preferred network for the specified SIM card slot. 1205 * 1206 * @permission ohos.permission.SET_TELEPHONY_STATE 1207 * @param { number } slotId - Indicates the card slot index number, 1208 * ranging from 0 to the maximum card slot index number supported by the device. 1209 * @param { PreferredNetworkMode } networkMode - Indicates that you want to set the preferred network mode. 1210 * @returns { Promise<void> } The promise returned by the setPreferredNetwork. 1211 * @throws { BusinessError } 201 - Permission denied. 1212 * @throws { BusinessError } 202 - Non-system applications use system APIs. 1213 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1214 * 2. Incorrect parameter types. 1215 * @throws { BusinessError } 8300001 - Invalid parameter value. 1216 * @throws { BusinessError } 8300002 - Service connection failed. 1217 * @throws { BusinessError } 8300003 - System internal error. 1218 * @throws { BusinessError } 8300999 - Unknown error. 1219 * @syscap SystemCapability.Telephony.CoreService 1220 * @systemapi Hide this for inner system use. 1221 * @since 8 1222 */ 1223 function setPreferredNetwork(slotId: number, networkMode: PreferredNetworkMode): Promise<void>; 1224 1225 /** 1226 * Get the preferred network for the specified SIM card slot. 1227 * 1228 * @permission ohos.permission.GET_TELEPHONY_STATE 1229 * @param { number } slotId - Indicates the card slot index number, 1230 * ranging from 0 to the maximum card slot index number supported by the device. 1231 * @param { AsyncCallback<PreferredNetworkMode> } callback - Indicates the callback for getting 1232 * the preferred network mode to obtain. 1233 * @throws { BusinessError } 201 - Permission denied. 1234 * @throws { BusinessError } 202 - Non-system applications use system APIs. 1235 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1236 * 2. Incorrect parameter types. 1237 * @throws { BusinessError } 8300001 - Invalid parameter value. 1238 * @throws { BusinessError } 8300002 - Service connection failed. 1239 * @throws { BusinessError } 8300003 - System internal error. 1240 * @throws { BusinessError } 8300999 - Unknown error. 1241 * @syscap SystemCapability.Telephony.CoreService 1242 * @systemapi Hide this for inner system use. 1243 * @since 8 1244 */ 1245 function getPreferredNetwork(slotId: number, callback: AsyncCallback<PreferredNetworkMode>): void; 1246 1247 /** 1248 * Get the preferred network for the specified SIM card slot. 1249 * 1250 * @permission ohos.permission.GET_TELEPHONY_STATE 1251 * @param { number } slotId - Indicates the card slot index number, 1252 * ranging from 0 to the maximum card slot index number supported by the device. 1253 * @returns { Promise<PreferredNetworkMode> } Returns the callback for getting the preferred network mode to obtain. 1254 * @throws { BusinessError } 201 - Permission denied. 1255 * @throws { BusinessError } 202 - Non-system applications use system APIs. 1256 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1257 * 2. Incorrect parameter types. 1258 * @throws { BusinessError } 8300001 - Invalid parameter value. 1259 * @throws { BusinessError } 8300002 - Service connection failed. 1260 * @throws { BusinessError } 8300003 - System internal error. 1261 * @throws { BusinessError } 8300999 - Unknown error. 1262 * @syscap SystemCapability.Telephony.CoreService 1263 * @systemapi Hide this for inner system use. 1264 * @since 8 1265 */ 1266 function getPreferredNetwork(slotId: number): Promise<PreferredNetworkMode>; 1267 1268 /** 1269 * Get the IMS registration state info of specified IMS service type. 1270 * 1271 * @permission ohos.permission.GET_TELEPHONY_STATE 1272 * @param { number } slotId - Indicates the card slot index number, 1273 * ranging from 0 to the maximum card slot index number supported by the device. 1274 * @param { ImsServiceType } imsType - Indicates the ims service type of the {@link ImsServiceType}. 1275 * @param { AsyncCallback<ImsRegInfo> } callback - Indicates an instance of the {@link ImsRegInfo} class. 1276 * @throws { BusinessError } 201 - Permission denied. 1277 * @throws { BusinessError } 202 - Non-system applications use system APIs. 1278 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1279 * @throws { BusinessError } 8300001 - Invalid parameter value. 1280 * @throws { BusinessError } 8300002 - Service connection failed. 1281 * @throws { BusinessError } 8300003 - System internal error. 1282 * @throws { BusinessError } 8300999 - Unknown error. 1283 * @syscap SystemCapability.Telephony.CoreService 1284 * @systemapi Hide this for inner system use. 1285 * @since 9 1286 */ 1287 function getImsRegInfo(slotId: number, imsType: ImsServiceType, callback: AsyncCallback<ImsRegInfo>): void; 1288 1289 /** 1290 * Get the IMS registration state info of specified IMS service type. 1291 * 1292 * @permission ohos.permission.GET_TELEPHONY_STATE 1293 * @param { number } slotId - Indicates the card slot index number, 1294 * ranging from 0 to the maximum card slot index number supported by the device. 1295 * @param { ImsServiceType } imsType - Indicates the ims service type of the {@link ImsServiceType}. 1296 * @returns { Promise<ImsRegInfo> } Returns an instance of the {@link ImsRegInfo} class. 1297 * @throws { BusinessError } 201 - Permission denied. 1298 * @throws { BusinessError } 202 - Non-system applications use system APIs. 1299 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1300 * @throws { BusinessError } 8300001 - Invalid parameter value. 1301 * @throws { BusinessError } 8300002 - Service connection failed. 1302 * @throws { BusinessError } 8300003 - System internal error. 1303 * @throws { BusinessError } 8300999 - Unknown error. 1304 * @syscap SystemCapability.Telephony.CoreService 1305 * @systemapi Hide this for inner system use. 1306 * @since 9 1307 */ 1308 function getImsRegInfo(slotId: number, imsType: ImsServiceType): Promise<ImsRegInfo>; 1309 1310 /** 1311 * Called when the IMS registration state of specified IMS service type corresponding to 1312 * a monitored {@code slotId} updates. 1313 * 1314 * @permission ohos.permission.GET_TELEPHONY_STATE 1315 * @param { 'imsRegStateChange' } type - Event type. Indicates the imsRegStateChange event to be subscribed to. 1316 * @param { number } slotId - Indicates the card slot index number, 1317 * ranging from 0 to the maximum card slot index number supported by the device. 1318 * @param { ImsServiceType } imsType - Indicates the ims service type of the {@link ImsServiceType}. 1319 * @param { Callback<ImsRegInfo> } callback - Indicates the callback for getting an instance of 1320 * the {@link ImsRegInfo} class. 1321 * @throws { BusinessError } 201 - Permission denied. 1322 * @throws { BusinessError } 202 - Non-system applications use system APIs. 1323 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1324 * @throws { BusinessError } 8300001 - Invalid parameter value. 1325 * @throws { BusinessError } 8300002 - Service connection failed. 1326 * @throws { BusinessError } 8300003 - System internal error. 1327 * @throws { BusinessError } 8300999 - Unknown error. 1328 * @syscap SystemCapability.Telephony.CoreService 1329 * @systemapi Hide this for inner system use. 1330 * @since 9 1331 */ 1332 function on(type: 'imsRegStateChange', slotId: number, imsType: ImsServiceType, callback: Callback<ImsRegInfo>): void; 1333 1334 /** 1335 * Unsubscribe from imsRegStateChange event. 1336 * 1337 * @permission ohos.permission.GET_TELEPHONY_STATE 1338 * @param { 'imsRegStateChange' } type - Event type. Indicates the imsRegStateChange event to unsubscribe from. 1339 * @param { number } slotId - Indicates the card slot index number, 1340 * ranging from 0 to the maximum card slot index number supported by the device. 1341 * @param { ImsServiceType } imsType - Indicates the ims service type of the {@link ImsServiceType}. 1342 * @param { Callback<ImsRegInfo> } callback - Indicates the callback for getting 1343 * an instance of the {@link ImsRegInfo} class. 1344 * @throws { BusinessError } 201 - Permission denied. 1345 * @throws { BusinessError } 202 - Non-system applications use system APIs. 1346 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1347 * @throws { BusinessError } 8300001 - Invalid parameter value. 1348 * @throws { BusinessError } 8300002 - Service connection failed. 1349 * @throws { BusinessError } 8300003 - System internal error. 1350 * @throws { BusinessError } 8300999 - Unknown error. 1351 * @syscap SystemCapability.Telephony.CoreService 1352 * @systemapi Hide this for inner system use. 1353 * @since 9 1354 */ 1355 function off(type: 'imsRegStateChange', slotId: number, imsType: ImsServiceType, callback?: Callback<ImsRegInfo>): void; 1356 1357 /** 1358 * Get the version of Baseband. 1359 * 1360 * @permission ohos.permission.GET_TELEPHONY_STATE 1361 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot index number 1362 * supported by the device. 1363 * @param { AsyncCallback<string> } callback - Indicates the callback for getting the baseband version. 1364 * @throws { BusinessError } 201 - Permission denied. 1365 * @throws { BusinessError } 202 - Non-system applications use system APIs. 1366 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1367 * 2. Incorrect parameter types. 1368 * @throws { BusinessError } 8300001 - Invalid parameter value. 1369 * @throws { BusinessError } 8300002 - Service connection failed. 1370 * @throws { BusinessError } 8300003 - System internal error. 1371 * @throws { BusinessError } 8300999 - Unknown error. 1372 * @syscap SystemCapability.Telephony.CoreService 1373 * @systemapi Hide this for inner system use. 1374 * @since 10 1375 */ 1376 function getBasebandVersion(slotId: number, callback: AsyncCallback<string>): void; 1377 1378 /** 1379 * Get the version of Baseband. 1380 * 1381 * @permission ohos.permission.GET_TELEPHONY_STATE 1382 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot index number 1383 * supported by the device. 1384 * @returns { Promise<string> } Returns the baseband version. 1385 * @throws { BusinessError } 201 - Permission denied. 1386 * @throws { BusinessError } 202 - Non-system applications use system APIs. 1387 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1388 * 2. Incorrect parameter types. 1389 * @throws { BusinessError } 8300001 - Invalid parameter value. 1390 * @throws { BusinessError } 8300002 - Service connection failed. 1391 * @throws { BusinessError } 8300003 - System internal error. 1392 * @throws { BusinessError } 8300999 - Unknown error. 1393 * @syscap SystemCapability.Telephony.CoreService 1394 * @systemapi Hide this for inner system use. 1395 * @since 10 1396 */ 1397 function getBasebandVersion(slotId: number): Promise<string>; 1398 1399 /** 1400 * Set the NR option mode. 1401 * 1402 * @permission ohos.permission.SET_TELEPHONY_STATE 1403 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot index 1404 * number supported by the device. 1405 * @param { NROptionMode } mode - Indicates the nr option mode to be set. 1406 * @param { AsyncCallback<void> } callback - Indicates the callback for getting the option result. 1407 * @throws { BusinessError } 201 - Permission denied. 1408 * @throws { BusinessError } 202 - Non-system applications use system APIs. 1409 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1410 * 2. Incorrect parameter types. 1411 * @throws { BusinessError } 8300001 - Invalid parameter value. 1412 * @throws { BusinessError } 8300002 - Service connection failed. 1413 * @throws { BusinessError } 8300003 - System internal error. 1414 * @throws { BusinessError } 8300999 - Unknown error. 1415 * @syscap SystemCapability.Telephony.CoreService 1416 * @systemapi Hide this for inner system use. 1417 * @since 10 1418 */ 1419 function setNROptionMode(slotId: number, mode: NROptionMode, callback: AsyncCallback<void>): void; 1420 1421 /** 1422 * Set the NR option mode. 1423 * 1424 * @permission ohos.permission.SET_TELEPHONY_STATE 1425 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot index 1426 * number supported by the device. 1427 * @param { NROptionMode } mode - Indicates the nr option mode to be set. 1428 * @returns { Promise<void> } Returns option result. 1429 * @throws { BusinessError } 201 - Permission denied. 1430 * @throws { BusinessError } 202 - Non-system applications use system APIs. 1431 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1432 * 2. Incorrect parameter types. 1433 * @throws { BusinessError } 8300001 - Invalid parameter value. 1434 * @throws { BusinessError } 8300002 - Service connection failed. 1435 * @throws { BusinessError } 8300003 - System internal error. 1436 * @throws { BusinessError } 8300999 - Unknown error. 1437 * @syscap SystemCapability.Telephony.CoreService 1438 * @systemapi Hide this for inner system use. 1439 * @since 10 1440 */ 1441 function setNROptionMode(slotId: number, mode: NROptionMode): Promise<void>; 1442 1443 /** 1444 * Get the option mode of NR. 1445 * 1446 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot 1447 * index number supported by the device. 1448 * @param { AsyncCallback<NROptionMode> } callback - Indicates the callback for getting the selection mode of NR. 1449 * @throws { BusinessError } 202 - Non-system applications use system APIs. 1450 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1451 * 2. Incorrect parameter types. 1452 * @throws { BusinessError } 8300001 - Invalid parameter value. 1453 * @throws { BusinessError } 8300002 - Service connection failed. 1454 * @throws { BusinessError } 8300003 - System internal error. 1455 * @throws { BusinessError } 8300999 - Unknown error. 1456 * @syscap SystemCapability.Telephony.CoreService 1457 * @systemapi Hide this for inner system use. 1458 * @since 10 1459 */ 1460 function getNROptionMode(slotId: number, callback: AsyncCallback<NROptionMode>): void; 1461 1462 /** 1463 * Get the option mode of NR. 1464 * 1465 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot 1466 * index number supported by the device. 1467 * @returns { Promise<NROptionMode> } Returns the selection mode of NR. 1468 * @throws { BusinessError } 202 - Non-system applications use system APIs. 1469 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1470 * 2. Incorrect parameter types. 1471 * @throws { BusinessError } 8300001 - Invalid parameter value. 1472 * @throws { BusinessError } 8300002 - Service connection failed. 1473 * @throws { BusinessError } 8300003 - System internal error. 1474 * @throws { BusinessError } 8300999 - Unknown error. 1475 * @syscap SystemCapability.Telephony.CoreService 1476 * @systemapi Hide this for inner system use. 1477 * @since 10 1478 */ 1479 function getNROptionMode(slotId: number): Promise<NROptionMode>; 1480 1481 /** 1482 * Set the type and state for the specified network capability. 1483 * 1484 * @permission ohos.permission.SET_TELEPHONY_STATE 1485 * @param { number } slotId - Indicates the card slot index number, 1486 * ranging from 0 to the maximum card slot index number supported by the device. 1487 * @param { NetworkCapabilityType } type - Indicates the service type of the {@link NetworkCapabilityType}. 1488 * @param { NetworkCapabilityState } state - Indicates the service ability state of the {@link NetworkCapabilityState}. 1489 * @param { AsyncCallback<void> } callback - The callback of setNetworkCapability. 1490 * @throws { BusinessError } 201 - Permission denied. 1491 * @throws { BusinessError } 202 - Non-system applications use system APIs. 1492 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1493 * 2. Incorrect parameter types. 1494 * @throws { BusinessError } 8300001 - Invalid parameter value. 1495 * @throws { BusinessError } 8300002 - Service connection failed. 1496 * @throws { BusinessError } 8300003 - System internal error. 1497 * @throws { BusinessError } 8300999 - Unknown error. 1498 * @syscap SystemCapability.Telephony.CoreService 1499 * @systemapi Hide this for inner system use. 1500 * @since 10 1501 */ 1502 function setNetworkCapability(slotId: number, type: NetworkCapabilityType, state: NetworkCapabilityState, 1503 callback: AsyncCallback<void>): void; 1504 1505 /** 1506 * Set the type and state for the specified network capability. 1507 * 1508 * @permission ohos.permission.SET_TELEPHONY_STATE 1509 * @param { number } slotId - Indicates the card slot index number, 1510 * ranging from 0 to the maximum card slot index number supported by the device. 1511 * @param { NetworkCapabilityType } type - Indicates the service type of the {@link NetworkCapabilityType}. 1512 * @param { NetworkCapabilityState } state - Indicates the service ability state of the {@link NetworkCapabilityState}. 1513 * @returns { Promise<void> } The promise returned by the setNetworkCapability. 1514 * @throws { BusinessError } 201 - Permission denied. 1515 * @throws { BusinessError } 202 - Non-system applications use system APIs. 1516 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1517 * 2. Incorrect parameter types. 1518 * @throws { BusinessError } 8300001 - Invalid parameter value. 1519 * @throws { BusinessError } 8300002 - Service connection failed. 1520 * @throws { BusinessError } 8300003 - System internal error. 1521 * @throws { BusinessError } 8300999 - Unknown error. 1522 * @syscap SystemCapability.Telephony.CoreService 1523 * @systemapi Hide this for inner system use. 1524 * @since 10 1525 */ 1526 function setNetworkCapability(slotId: number, type: NetworkCapabilityType, state: NetworkCapabilityState): Promise<void>; 1527 1528 /** 1529 * Get the network capability state according to the specified capability type. 1530 * 1531 * @permission ohos.permission.GET_TELEPHONY_STATE 1532 * @param { number } slotId - Indicates the card slot index number, 1533 * ranging from 0 to the maximum card slot index number supported by the device. 1534 * @param { NetworkCapabilityType } type - Indicates the service type of the {@link NetworkCapabilityType}. 1535 * @param { AsyncCallback<NetworkCapabilityState> } callback - Indicates the callback for getting 1536 * the network capability state. 1537 * @throws { BusinessError } 201 - Permission denied. 1538 * @throws { BusinessError } 202 - Non-system applications use system APIs. 1539 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1540 * 2. Incorrect parameter types. 1541 * @throws { BusinessError } 8300001 - Invalid parameter value. 1542 * @throws { BusinessError } 8300002 - Service connection failed. 1543 * @throws { BusinessError } 8300003 - System internal error. 1544 * @throws { BusinessError } 8300999 - Unknown error. 1545 * @syscap SystemCapability.Telephony.CoreService 1546 * @systemapi Hide this for inner system use. 1547 * @since 10 1548 */ 1549 function getNetworkCapability(slotId: number, type: NetworkCapabilityType, 1550 callback: AsyncCallback<NetworkCapabilityState>): void; 1551 1552 /** 1553 * Get the network capability state according to the specified capability type. 1554 * 1555 * @permission ohos.permission.GET_TELEPHONY_STATE 1556 * @param { number } slotId - Indicates the card slot index number, 1557 * ranging from 0 to the maximum card slot index number supported by the device. 1558 * @param { NetworkCapabilityType } type - Indicates the service type of the {@link NetworkCapabilityType}. 1559 * @returns { Promise<NetworkCapabilityState> } Returns the callback for getting the network capability state. 1560 * @throws { BusinessError } 201 - Permission denied. 1561 * @throws { BusinessError } 202 - Non-system applications use system APIs. 1562 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1563 * 2. Incorrect parameter types. 1564 * @throws { BusinessError } 8300001 - Invalid parameter value. 1565 * @throws { BusinessError } 8300002 - Service connection failed. 1566 * @throws { BusinessError } 8300003 - System internal error. 1567 * @throws { BusinessError } 8300999 - Unknown error. 1568 * @syscap SystemCapability.Telephony.CoreService 1569 * @systemapi Hide this for inner system use. 1570 * @since 10 1571 */ 1572 function getNetworkCapability(slotId: number, type: NetworkCapabilityType): Promise<NetworkCapabilityState>; 1573 1574 /** 1575 * Reset all network settings of telephony. 1576 * 1577 * @permission ohos.permission.SET_TELEPHONY_STATE 1578 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot 1579 * index number supported by the device. 1580 * @returns { Promise<void> } The promise returned by the factoryReset. 1581 * @throws { BusinessError } 201 - Permission denied. 1582 * @throws { BusinessError } 202 - Non-system applications use system APIs. 1583 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1584 * 2. Incorrect parameter types. 1585 * @throws { BusinessError } 8300001 - Invalid parameter value. 1586 * @throws { BusinessError } 8300002 - Service connection failed. 1587 * @throws { BusinessError } 8300003 - System internal error. 1588 * @throws { BusinessError } 8300999 - Unknown error. 1589 * @syscap SystemCapability.Telephony.CoreService 1590 * @systemapi Hide this for inner system use. 1591 * @since 11 1592 */ 1593 function factoryReset(slotId: number): Promise<void>; 1594 1595 /** 1596 * Obtains the software version number of a specified card slot of the device. 1597 * 1598 * @permission ohos.permission.GET_TELEPHONY_STATE 1599 * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot index number 1600 * supported by the device. 1601 * @returns { string } Returns the IMEISV. Returns an empty string if the IMEISV does not exist. 1602 * @throws { BusinessError } 201 - Permission denied. 1603 * @throws { BusinessError } 202 - Non-system applications use system APIs. 1604 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1605 * 2. Incorrect parameter types. 1606 * @throws { BusinessError } 8300001 - Invalid parameter value. 1607 * @throws { BusinessError } 8300002 - Service connection failed. 1608 * @throws { BusinessError } 8300003 - System internal error. 1609 * @throws { BusinessError } 8300999 - Unknown error. 1610 * @syscap SystemCapability.Telephony.CoreService 1611 * @systemapi Hide this for inner system use. 1612 * @since 12 1613 */ 1614 function getIMEISV(slotId: number): string; 1615 1616 /** 1617 * Indicates the preferred network. 1618 * 1619 * @enum { number } 1620 * @syscap SystemCapability.Telephony.CoreService 1621 * @systemapi Hide this for inner system use. 1622 * @since 8 1623 */ 1624 export enum PreferredNetworkMode { 1625 /** 1626 * Preferred GSM network mode. 1627 * 1628 * @syscap SystemCapability.Telephony.CoreService 1629 * @systemapi Hide this for inner system use. 1630 * @since 8 1631 */ 1632 PREFERRED_NETWORK_MODE_GSM = 1, 1633 1634 /** 1635 * Preferred WCDMA network mode. 1636 * 1637 * @syscap SystemCapability.Telephony.CoreService 1638 * @systemapi Hide this for inner system use. 1639 * @since 8 1640 */ 1641 PREFERRED_NETWORK_MODE_WCDMA = 2, 1642 1643 /** 1644 * Preferred LTE mode. 1645 * 1646 * @syscap SystemCapability.Telephony.CoreService 1647 * @systemapi Hide this for inner system use. 1648 * @since 8 1649 */ 1650 PREFERRED_NETWORK_MODE_LTE = 3, 1651 1652 /** 1653 * Preferred LTE/WCDMA network mode. 1654 * 1655 * @syscap SystemCapability.Telephony.CoreService 1656 * @systemapi Hide this for inner system use. 1657 * @since 8 1658 */ 1659 PREFERRED_NETWORK_MODE_LTE_WCDMA = 4, 1660 1661 /** 1662 * Preferred LTE/WCDMA/GSM network mode. 1663 * 1664 * @syscap SystemCapability.Telephony.CoreService 1665 * @systemapi Hide this for inner system use. 1666 * @since 8 1667 */ 1668 PREFERRED_NETWORK_MODE_LTE_WCDMA_GSM = 5, 1669 1670 /** 1671 * Preferred WCDMA/GSM network mode. 1672 * 1673 * @syscap SystemCapability.Telephony.CoreService 1674 * @systemapi Hide this for inner system use. 1675 * @since 8 1676 */ 1677 PREFERRED_NETWORK_MODE_WCDMA_GSM = 6, 1678 1679 /** 1680 * Preferred CDMA network mode. 1681 * 1682 * @syscap SystemCapability.Telephony.CoreService 1683 * @systemapi Hide this for inner system use. 1684 * @since 8 1685 */ 1686 PREFERRED_NETWORK_MODE_CDMA = 7, 1687 1688 /** 1689 * Preferred EVDO network mode. 1690 * 1691 * @syscap SystemCapability.Telephony.CoreService 1692 * @systemapi Hide this for inner system use. 1693 * @since 8 1694 */ 1695 PREFERRED_NETWORK_MODE_EVDO = 8, 1696 1697 /** 1698 * Preferred EVDO/CDMA network mode. 1699 * 1700 * @syscap SystemCapability.Telephony.CoreService 1701 * @systemapi Hide this for inner system use. 1702 * @since 8 1703 */ 1704 PREFERRED_NETWORK_MODE_EVDO_CDMA = 9, 1705 1706 /** 1707 * Preferred WCDMA/GSM/EVDO/CDMA network mode. 1708 * 1709 * @syscap SystemCapability.Telephony.CoreService 1710 * @systemapi Hide this for inner system use. 1711 * @since 8 1712 */ 1713 PREFERRED_NETWORK_MODE_WCDMA_GSM_EVDO_CDMA = 10, 1714 1715 /** 1716 * Preferred LTE/EVDO/CDMA network mode. 1717 * 1718 * @syscap SystemCapability.Telephony.CoreService 1719 * @systemapi Hide this for inner system use. 1720 * @since 8 1721 */ 1722 PREFERRED_NETWORK_MODE_LTE_EVDO_CDMA = 11, 1723 1724 /** 1725 * Preferred LTE/WCDMA/GSM/EVDO/CDMA network mode. 1726 * 1727 * @syscap SystemCapability.Telephony.CoreService 1728 * @systemapi Hide this for inner system use. 1729 * @since 8 1730 */ 1731 PREFERRED_NETWORK_MODE_LTE_WCDMA_GSM_EVDO_CDMA = 12, 1732 1733 /** 1734 * Preferred TDSCDMA network mode. 1735 * 1736 * @syscap SystemCapability.Telephony.CoreService 1737 * @systemapi Hide this for inner system use. 1738 * @since 8 1739 */ 1740 PREFERRED_NETWORK_MODE_TDSCDMA = 13, 1741 1742 /** 1743 * Preferred TDSCDMA/GSM network mode. 1744 * 1745 * @syscap SystemCapability.Telephony.CoreService 1746 * @systemapi Hide this for inner system use. 1747 * @since 8 1748 */ 1749 PREFERRED_NETWORK_MODE_TDSCDMA_GSM = 14, 1750 1751 /** 1752 * Preferred TDSCDMA/WCDMA network mode. 1753 * 1754 * @syscap SystemCapability.Telephony.CoreService 1755 * @systemapi Hide this for inner system use. 1756 * @since 8 1757 */ 1758 PREFERRED_NETWORK_MODE_TDSCDMA_WCDMA = 15, 1759 1760 /** 1761 * Preferred TDSCDMA/WCDMA/GSM network mode. 1762 * 1763 * @syscap SystemCapability.Telephony.CoreService 1764 * @systemapi Hide this for inner system use. 1765 * @since 8 1766 */ 1767 PREFERRED_NETWORK_MODE_TDSCDMA_WCDMA_GSM = 16, 1768 1769 /** 1770 * Preferred LTE/TDSCDMA network mode. 1771 * 1772 * @syscap SystemCapability.Telephony.CoreService 1773 * @systemapi Hide this for inner system use. 1774 * @since 8 1775 */ 1776 PREFERRED_NETWORK_MODE_LTE_TDSCDMA = 17, 1777 1778 /** 1779 * Preferred LTE/TDSCDMA/GSM network mode. 1780 * 1781 * @syscap SystemCapability.Telephony.CoreService 1782 * @systemapi Hide this for inner system use. 1783 * @since 8 1784 */ 1785 PREFERRED_NETWORK_MODE_LTE_TDSCDMA_GSM = 18, 1786 1787 /** 1788 * Preferred LTE/TDSCDMA/WCDMA network mode. 1789 * 1790 * @syscap SystemCapability.Telephony.CoreService 1791 * @systemapi Hide this for inner system use. 1792 * @since 8 1793 */ 1794 PREFERRED_NETWORK_MODE_LTE_TDSCDMA_WCDMA = 19, 1795 1796 /** 1797 * Preferred LTE/TDSCDMA/WCDMA/GSM network mode. 1798 * 1799 * @syscap SystemCapability.Telephony.CoreService 1800 * @systemapi Hide this for inner system use. 1801 * @since 8 1802 */ 1803 PREFERRED_NETWORK_MODE_LTE_TDSCDMA_WCDMA_GSM = 20, 1804 1805 /** 1806 * Preferred TDSCDMA/WCDMA/GSM/EVDO/CDMA network mode. 1807 * 1808 * @syscap SystemCapability.Telephony.CoreService 1809 * @systemapi Hide this for inner system use. 1810 * @since 8 1811 */ 1812 PREFERRED_NETWORK_MODE_TDSCDMA_WCDMA_GSM_EVDO_CDMA = 21, 1813 1814 /** 1815 * Preferred LTE/TDSCDMA/WCDMA/GSM/EVDO/CDMA network mode. 1816 * 1817 * @syscap SystemCapability.Telephony.CoreService 1818 * @systemapi Hide this for inner system use. 1819 * @since 8 1820 */ 1821 PREFERRED_NETWORK_MODE_LTE_TDSCDMA_WCDMA_GSM_EVDO_CDMA = 22, 1822 1823 /** 1824 * Preferred NR network mode. 1825 * 1826 * @syscap SystemCapability.Telephony.CoreService 1827 * @systemapi Hide this for inner system use. 1828 * @since 8 1829 */ 1830 PREFERRED_NETWORK_MODE_NR = 31, 1831 1832 /** 1833 * Preferred NR/LTE network mode. 1834 * 1835 * @syscap SystemCapability.Telephony.CoreService 1836 * @systemapi Hide this for inner system use. 1837 * @since 8 1838 */ 1839 PREFERRED_NETWORK_MODE_NR_LTE = 32, 1840 1841 /** 1842 * Preferred NR/LTE/WCDMA network mode. 1843 * 1844 * @syscap SystemCapability.Telephony.CoreService 1845 * @systemapi Hide this for inner system use. 1846 * @since 8 1847 */ 1848 PREFERRED_NETWORK_MODE_NR_LTE_WCDMA = 33, 1849 1850 /** 1851 * Preferred NR/LTE/WCDMA/GSM network mode. 1852 * 1853 * @syscap SystemCapability.Telephony.CoreService 1854 * @systemapi Hide this for inner system use. 1855 * @since 8 1856 */ 1857 PREFERRED_NETWORK_MODE_NR_LTE_WCDMA_GSM = 34, 1858 1859 /** 1860 * Preferred NR/LTE/EVDO/CDMA network mode. 1861 * 1862 * @syscap SystemCapability.Telephony.CoreService 1863 * @systemapi Hide this for inner system use. 1864 * @since 8 1865 */ 1866 PREFERRED_NETWORK_MODE_NR_LTE_EVDO_CDMA = 35, 1867 1868 /** 1869 * Preferred NR/LTE/WCDMA/GSM/EVDO/CDMA network mode. 1870 * 1871 * @syscap SystemCapability.Telephony.CoreService 1872 * @systemapi Hide this for inner system use. 1873 * @since 8 1874 */ 1875 PREFERRED_NETWORK_MODE_NR_LTE_WCDMA_GSM_EVDO_CDMA = 36, 1876 1877 /** 1878 * Preferred NR/LTE/TDSCDMA network mode. 1879 * 1880 * @syscap SystemCapability.Telephony.CoreService 1881 * @systemapi Hide this for inner system use. 1882 * @since 8 1883 */ 1884 PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA = 37, 1885 1886 /** 1887 * Preferred NR/LTE/TDSCDMA/GSM network mode. 1888 * 1889 * @syscap SystemCapability.Telephony.CoreService 1890 * @systemapi Hide this for inner system use. 1891 * @since 8 1892 */ 1893 PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA_GSM = 38, 1894 1895 /** 1896 * Preferred NR/LTE/TDSCDMA/WCDMA network mode. 1897 * 1898 * @syscap SystemCapability.Telephony.CoreService 1899 * @systemapi Hide this for inner system use. 1900 * @since 8 1901 */ 1902 PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA_WCDMA = 39, 1903 1904 /** 1905 * Preferred NR/LTE/TDSCDMA/WCDMA/GSM network mode. 1906 * 1907 * @syscap SystemCapability.Telephony.CoreService 1908 * @systemapi Hide this for inner system use. 1909 * @since 8 1910 */ 1911 PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA_WCDMA_GSM = 40, 1912 1913 /** 1914 * Preferred NR/LTE/TDSCDMA/WCDMA/GSM/EVDO/CDMA network mode. 1915 * 1916 * @syscap SystemCapability.Telephony.CoreService 1917 * @systemapi Hide this for inner system use. 1918 * @since 8 1919 */ 1920 PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA_WCDMA_GSM_EVDO_CDMA = 41, 1921 1922 /** 1923 * Preferred network mode Maximum. 1924 * 1925 * @syscap SystemCapability.Telephony.CoreService 1926 * @systemapi Hide this for inner system use. 1927 * @since 8 1928 */ 1929 PREFERRED_NETWORK_MODE_MAX_VALUE = 99, 1930 } 1931 1932 /** 1933 * Describes the radio access technology (RAT) of registered network. 1934 * 1935 * @interface NetworkRadioTech 1936 * @syscap SystemCapability.Telephony.CoreService 1937 * @since 11 1938 */ 1939 export interface NetworkRadioTech { 1940 /** 1941 * Indicates radio access technology (RAT) of packet service (PS) domain. 1942 * 1943 * @type { RadioTechnology } 1944 * @syscap SystemCapability.Telephony.CoreService 1945 * @since 11 1946 */ 1947 psRadioTech: RadioTechnology; 1948 1949 /** 1950 * Indicates radio access technology (RAT) of circuit service (CS) domain. 1951 * 1952 * @type { RadioTechnology } 1953 * @syscap SystemCapability.Telephony.CoreService 1954 * @since 11 1955 */ 1956 csRadioTech: RadioTechnology; 1957 } 1958 1959 /** 1960 * Describes the radio access technology. 1961 * 1962 * @enum { number } 1963 * @syscap SystemCapability.Telephony.CoreService 1964 * @since 6 1965 */ 1966 export enum RadioTechnology { 1967 /** 1968 * Indicates unknown radio access technology (RAT). 1969 * 1970 * @syscap SystemCapability.Telephony.CoreService 1971 * @since 6 1972 */ 1973 RADIO_TECHNOLOGY_UNKNOWN = 0, 1974 1975 /** 1976 * Indicates that RAT is global system for mobile communications (GSM), including GSM, general packet 1977 * radio system (GPRS), and enhanced data rates for GSM evolution (EDGE). 1978 * 1979 * @syscap SystemCapability.Telephony.CoreService 1980 * @since 6 1981 */ 1982 RADIO_TECHNOLOGY_GSM = 1, 1983 1984 /** 1985 * Indicates that RAT is code division multiple access (CDMA), including Interim Standard 95 (IS95) and 1986 * Single-Carrier Radio Transmission Technology (1xRTT). 1987 * 1988 * @syscap SystemCapability.Telephony.CoreService 1989 * @since 6 1990 */ 1991 RADIO_TECHNOLOGY_1XRTT = 2, 1992 1993 /** 1994 * Indicates that RAT is wideband code division multiple address (WCDMA). 1995 * 1996 * @syscap SystemCapability.Telephony.CoreService 1997 * @since 6 1998 */ 1999 RADIO_TECHNOLOGY_WCDMA = 3, 2000 2001 /** 2002 * Indicates that RAT is high-speed packet access (HSPA), including HSPA, high-speed downlink packet 2003 * access (HSDPA), and high-speed uplink packet access (HSUPA). 2004 * 2005 * @syscap SystemCapability.Telephony.CoreService 2006 * @since 6 2007 */ 2008 RADIO_TECHNOLOGY_HSPA = 4, 2009 2010 /** 2011 * Indicates that RAT is evolved high-speed packet access (HSPA+), including HSPA+ and dual-carrier 2012 * HSPA+ (DC-HSPA+). 2013 * 2014 * @syscap SystemCapability.Telephony.CoreService 2015 * @since 6 2016 */ 2017 RADIO_TECHNOLOGY_HSPAP = 5, 2018 2019 /** 2020 * Indicates that RAT is time division-synchronous code division multiple access (TD-SCDMA). 2021 * 2022 * @syscap SystemCapability.Telephony.CoreService 2023 * @since 6 2024 */ 2025 RADIO_TECHNOLOGY_TD_SCDMA = 6, 2026 2027 /** 2028 * Indicates that RAT is evolution data only (EVDO), including EVDO Rev.0, EVDO Rev.A, and EVDO Rev.B. 2029 * 2030 * @syscap SystemCapability.Telephony.CoreService 2031 * @since 6 2032 */ 2033 RADIO_TECHNOLOGY_EVDO = 7, 2034 2035 /** 2036 * Indicates that RAT is evolved high rate packet data (EHRPD). 2037 * 2038 * @syscap SystemCapability.Telephony.CoreService 2039 * @since 6 2040 */ 2041 RADIO_TECHNOLOGY_EHRPD = 8, 2042 2043 /** 2044 * Indicates that RAT is long term evolution (LTE). 2045 * 2046 * @syscap SystemCapability.Telephony.CoreService 2047 * @since 6 2048 */ 2049 RADIO_TECHNOLOGY_LTE = 9, 2050 2051 /** 2052 * Indicates that RAT is LTE carrier aggregation (LTE-CA). 2053 * 2054 * @syscap SystemCapability.Telephony.CoreService 2055 * @since 6 2056 */ 2057 RADIO_TECHNOLOGY_LTE_CA = 10, 2058 2059 /** 2060 * Indicates that RAT is interworking WLAN (I-WLAN). 2061 * 2062 * @syscap SystemCapability.Telephony.CoreService 2063 * @since 6 2064 */ 2065 RADIO_TECHNOLOGY_IWLAN = 11, 2066 2067 /** 2068 * Indicates that RAT is 5G new radio (NR). 2069 * 2070 * @syscap SystemCapability.Telephony.CoreService 2071 * @since 6 2072 */ 2073 RADIO_TECHNOLOGY_NR = 12 2074 } 2075 2076 /** 2077 * Returns child class objects specific to the network type. 2078 * 2079 * @interface SignalInformation 2080 * @syscap SystemCapability.Telephony.CoreService 2081 * @since 6 2082 */ 2083 export interface SignalInformation { 2084 /** 2085 * Obtains the network type corresponding to the signal. 2086 * 2087 * @type { NetworkType } 2088 * @syscap SystemCapability.Telephony.CoreService 2089 * @since 6 2090 */ 2091 signalType: NetworkType; 2092 2093 /** 2094 * Obtains the signal level of the current network. 2095 * 2096 * @type { number } 2097 * @syscap SystemCapability.Telephony.CoreService 2098 * @since 6 2099 */ 2100 signalLevel: number; 2101 2102 /** 2103 * rsrp for LTE and NR; dbm for CDMA and EVDO; rscp for WCDMA; rssi for GSM. 2104 * 2105 * @type { number } 2106 * @syscap SystemCapability.Telephony.CoreService 2107 * @since 9 2108 */ 2109 dBm: number; 2110 } 2111 2112 /** 2113 * Describes the network type. 2114 * 2115 * @enum { number } 2116 * @syscap SystemCapability.Telephony.CoreService 2117 * @since 6 2118 */ 2119 export enum NetworkType { 2120 /** 2121 * Indicates unknown network type. 2122 * 2123 * @syscap SystemCapability.Telephony.CoreService 2124 * @since 6 2125 */ 2126 NETWORK_TYPE_UNKNOWN, 2127 2128 /** 2129 * Indicates that the network type is GSM. 2130 * 2131 * @syscap SystemCapability.Telephony.CoreService 2132 * @since 6 2133 */ 2134 NETWORK_TYPE_GSM, 2135 2136 /** 2137 * Indicates that the network type is CDMA. 2138 * 2139 * @syscap SystemCapability.Telephony.CoreService 2140 * @since 6 2141 */ 2142 NETWORK_TYPE_CDMA, 2143 2144 /** 2145 * Indicates that the network type is WCDMA. 2146 * 2147 * @syscap SystemCapability.Telephony.CoreService 2148 * @since 6 2149 */ 2150 NETWORK_TYPE_WCDMA, 2151 2152 /** 2153 * Indicates that the network type is TD-SCDMA. 2154 * 2155 * @syscap SystemCapability.Telephony.CoreService 2156 * @since 6 2157 */ 2158 NETWORK_TYPE_TDSCDMA, 2159 2160 /** 2161 * Indicates that the network type is LTE. 2162 * 2163 * @syscap SystemCapability.Telephony.CoreService 2164 * @since 6 2165 */ 2166 NETWORK_TYPE_LTE, 2167 2168 /** 2169 * Indicates that the network type is 5G NR. 2170 * 2171 * @syscap SystemCapability.Telephony.CoreService 2172 * @since 6 2173 */ 2174 NETWORK_TYPE_NR 2175 } 2176 2177 /** 2178 * Describes the network registration state. 2179 * 2180 * @interface NetworkState 2181 * @syscap SystemCapability.Telephony.CoreService 2182 * @since 6 2183 */ 2184 export interface NetworkState { 2185 /** 2186 * Obtains the operator name in the long alphanumeric format of the registered network. 2187 * 2188 * Returns the operator name in the long alphanumeric format as a string; 2189 * returns an empty string if no operator name is obtained. 2190 * 2191 * @type { string } 2192 * @syscap SystemCapability.Telephony.CoreService 2193 * @since 6 2194 */ 2195 longOperatorName: string; 2196 2197 /** 2198 * Obtains the operator name in the short alphanumeric format of the registered network. 2199 * 2200 * Returns the operator name in the short alphanumeric format as a string; 2201 * returns an empty string if no operator name is obtained. 2202 * 2203 * @type { string } 2204 * @syscap SystemCapability.Telephony.CoreService 2205 * @since 6 2206 */ 2207 shortOperatorName: string; 2208 2209 /** 2210 * Obtains the PLMN code of the registered network. 2211 * 2212 * Returns the PLMN code as a string; returns an empty string if no operator name is obtained. 2213 * 2214 * @type { string } 2215 * @syscap SystemCapability.Telephony.CoreService 2216 * @since 6 2217 */ 2218 plmnNumeric: string; 2219 2220 /** 2221 * Checks whether the device is roaming. 2222 * 2223 * @type { boolean } 2224 * @syscap SystemCapability.Telephony.CoreService 2225 * @since 6 2226 */ 2227 isRoaming: boolean; 2228 2229 /** 2230 * Obtains the network registration status of the device. 2231 * 2232 * @type { RegState } 2233 * @syscap SystemCapability.Telephony.CoreService 2234 * @since 6 2235 */ 2236 regState: RegState; 2237 2238 /** 2239 * Obtains the radio Access technology after config conversion. 2240 * 2241 * @type { RadioTechnology } 2242 * @syscap SystemCapability.Telephony.CoreService 2243 * @since 8 2244 */ 2245 cfgTech: RadioTechnology; 2246 2247 /** 2248 * Obtains the NSA network registration status of the device. 2249 * 2250 * Returns the NSA network registration status {@code NsaState}. 2251 * 2252 * @type { NsaState } 2253 * @syscap SystemCapability.Telephony.CoreService 2254 * @since 6 2255 */ 2256 nsaState: NsaState; 2257 2258 /** 2259 * Obtains the status of CA. 2260 * 2261 * Returns {@code true} if CA is actived; returns {@code false} otherwise. 2262 * 2263 * @type { boolean } 2264 * @syscap SystemCapability.Telephony.CoreService 2265 * @since 6 2266 */ 2267 isCaActive: boolean; 2268 2269 /** 2270 * Checks whether this device is allowed to make emergency calls only. 2271 * 2272 * Returns {@code true} if this device is allowed to make emergency calls only; 2273 * returns {@code false} otherwise. 2274 * 2275 * @type { boolean } 2276 * @syscap SystemCapability.Telephony.CoreService 2277 * @since 6 2278 */ 2279 isEmergency: boolean; 2280 } 2281 2282 /** 2283 * Describes the network registration state. 2284 * 2285 * @enum { number } 2286 * @syscap SystemCapability.Telephony.CoreService 2287 * @since 6 2288 */ 2289 export enum RegState { 2290 /** 2291 * Indicates a state in which a device cannot use any service. 2292 * 2293 * @syscap SystemCapability.Telephony.CoreService 2294 * @since 6 2295 */ 2296 REG_STATE_NO_SERVICE = 0, 2297 2298 /** 2299 * Indicates a state in which a device can use services properly. 2300 * 2301 * @syscap SystemCapability.Telephony.CoreService 2302 * @since 6 2303 */ 2304 REG_STATE_IN_SERVICE = 1, 2305 2306 /** 2307 * Indicates a state in which a device can use only the emergency call service. 2308 * 2309 * @syscap SystemCapability.Telephony.CoreService 2310 * @since 6 2311 */ 2312 REG_STATE_EMERGENCY_CALL_ONLY = 2, 2313 2314 /** 2315 * Indicates that the cellular radio is powered off. 2316 * 2317 * @syscap SystemCapability.Telephony.CoreService 2318 * @since 6 2319 */ 2320 REG_STATE_POWER_OFF = 3 2321 } 2322 2323 /** 2324 * Describes the nsa state. 2325 * 2326 * @enum { number } 2327 * @syscap SystemCapability.Telephony.CoreService 2328 * @since 6 2329 */ 2330 export enum NsaState { 2331 /** 2332 * Indicates that a device is idle under or is connected to an LTE cell that does not support NSA. 2333 * 2334 * @syscap SystemCapability.Telephony.CoreService 2335 * @since 6 2336 */ 2337 NSA_STATE_NOT_SUPPORT = 1, 2338 2339 /** 2340 * Indicates that a device is idle under an LTE cell supporting NSA but not NR coverage detection. 2341 * 2342 * @syscap SystemCapability.Telephony.CoreService 2343 * @since 6 2344 */ 2345 NSA_STATE_NO_DETECT = 2, 2346 2347 /** 2348 * Indicates that a device is connected to an LTE network under an LTE cell 2349 * that supports NSA and NR coverage detection. 2350 * 2351 * @syscap SystemCapability.Telephony.CoreService 2352 * @since 6 2353 */ 2354 NSA_STATE_CONNECTED_DETECT = 3, 2355 2356 /** 2357 * Indicates that a device is idle under an LTE cell supporting NSA and NR coverage detection. 2358 * 2359 * @syscap SystemCapability.Telephony.CoreService 2360 * @since 6 2361 */ 2362 NSA_STATE_IDLE_DETECT = 4, 2363 2364 /** 2365 * Indicates that a device is connected to an LTE + NR network under an LTE cell that supports NSA. 2366 * 2367 * @syscap SystemCapability.Telephony.CoreService 2368 * @since 6 2369 */ 2370 NSA_STATE_DUAL_CONNECTED = 5, 2371 2372 /** 2373 * Indicates that a device is idle under or is connected to an NG-RAN cell while being attached to 5GC. 2374 * 2375 * @syscap SystemCapability.Telephony.CoreService 2376 * @since 6 2377 */ 2378 NSA_STATE_SA_ATTACHED = 6 2379 } 2380 2381 /** 2382 * Obtains current cell information. 2383 * 2384 * @interface CellInformation 2385 * @syscap SystemCapability.Telephony.CoreService 2386 * @since 8 2387 */ 2388 export interface CellInformation { 2389 /** 2390 * Obtains the network type of the serving cell. 2391 * 2392 * An application can call this method to determine the network type that the child class uses. 2393 * 2394 * @type { NetworkType } 2395 * @syscap SystemCapability.Telephony.CoreService 2396 * @since 8 2397 */ 2398 networkType: NetworkType; 2399 2400 /** 2401 * Obtains the camp-on status of the serving cell. 2402 * 2403 * Returns {@code true} if the user equipment (UE) is camped on the cell; returns {@code false} otherwise. 2404 * 2405 * @type { boolean } 2406 * @syscap SystemCapability.Telephony.CoreService 2407 * @systemapi Hide this for inner system use. 2408 * @since 8 2409 */ 2410 isCamped: boolean; 2411 2412 /** 2413 * Obtains the timestamp when the cell information is obtained. 2414 * 2415 * Returns a timestamp since boot, in nanoseconds. 2416 * 2417 * @type { number } 2418 * @syscap SystemCapability.Telephony.CoreService 2419 * @systemapi Hide this for inner system use. 2420 * @since 8 2421 */ 2422 timeStamp: number; 2423 2424 /** 2425 * An abstract method of the parent class whose implementation depends on the child classes. 2426 * Returned child class objects vary according to the network type. 2427 * Returns child class objects specific to the network type. 2428 * 2429 * @type { SignalInformation } 2430 * @syscap SystemCapability.Telephony.CoreService 2431 * @since 8 2432 */ 2433 signalInformation: SignalInformation; 2434 2435 /** 2436 * Obtains signal strength under different network formats. 2437 * 2438 * @type { CdmaCellInformation | GsmCellInformation | LteCellInformation | NrCellInformation 2439 * | TdscdmaCellInformation | WcdmaCellInformation } 2440 * @syscap SystemCapability.Telephony.CoreService 2441 * @systemapi Hide this for inner system use. 2442 * @since 8 2443 */ 2444 data: CdmaCellInformation | GsmCellInformation | LteCellInformation | NrCellInformation | TdscdmaCellInformation 2445 | WcdmaCellInformation; 2446 } 2447 2448 /** 2449 * Obtains CDMA cell information. 2450 * 2451 * @interface CdmaCellInformation 2452 * @syscap SystemCapability.Telephony.CoreService 2453 * @systemapi Hide this for inner system use. 2454 * @since 8 2455 */ 2456 export interface CdmaCellInformation { 2457 /** 2458 * Indicates the base station Id. 2459 * 2460 * @type { number } 2461 * @syscap SystemCapability.Telephony.CoreService 2462 * @systemapi Hide this for inner system use. 2463 * @since 8 2464 */ 2465 baseId: number; 2466 2467 /** 2468 * Indicates the latitude. 2469 * 2470 * @type { number } 2471 * @syscap SystemCapability.Telephony.CoreService 2472 * @systemapi Hide this for inner system use. 2473 * @since 8 2474 */ 2475 latitude: number; 2476 2477 /** 2478 * Indicates the longitude. 2479 * 2480 * @type { number } 2481 * @syscap SystemCapability.Telephony.CoreService 2482 * @systemapi Hide this for inner system use. 2483 * @since 8 2484 */ 2485 longitude: number; 2486 2487 /** 2488 * Indicates the network identification code. 2489 * 2490 * @type { number } 2491 * @syscap SystemCapability.Telephony.CoreService 2492 * @systemapi Hide this for inner system use. 2493 * @since 8 2494 */ 2495 nid: number; 2496 2497 /** 2498 * Indicates the system identification code. 2499 * 2500 * @type { number } 2501 * @syscap SystemCapability.Telephony.CoreService 2502 * @systemapi Hide this for inner system use. 2503 * @since 8 2504 */ 2505 sid: number; 2506 } 2507 2508 /** 2509 * Obtains GSM cell information. 2510 * 2511 * @interface GsmCellInformation 2512 * @syscap SystemCapability.Telephony.CoreService 2513 * @systemapi Hide this for inner system use. 2514 * @since 8 2515 */ 2516 export interface GsmCellInformation { 2517 /** 2518 * Indicates the location area code. 2519 * 2520 * @type { number } 2521 * @syscap SystemCapability.Telephony.CoreService 2522 * @systemapi Hide this for inner system use. 2523 * @since 8 2524 */ 2525 lac: number; 2526 2527 /** 2528 * Indicates the cell identification. 2529 * 2530 * @type { number } 2531 * @syscap SystemCapability.Telephony.CoreService 2532 * @systemapi Hide this for inner system use. 2533 * @since 8 2534 */ 2535 cellId: number; 2536 2537 /** 2538 * Indicates the ARFCN(absolute radio frequency channel number). 2539 * 2540 * @type { number } 2541 * @syscap SystemCapability.Telephony.CoreService 2542 * @systemapi Hide this for inner system use. 2543 * @since 8 2544 */ 2545 arfcn: number; 2546 2547 /** 2548 * Indicates the base station identification code. 2549 * 2550 * @type { number } 2551 * @syscap SystemCapability.Telephony.CoreService 2552 * @systemapi Hide this for inner system use. 2553 * @since 8 2554 */ 2555 bsic: number; 2556 2557 /** 2558 * Indicates the mobile country code. 2559 * 2560 * @type { string } 2561 * @syscap SystemCapability.Telephony.CoreService 2562 * @systemapi Hide this for inner system use. 2563 * @since 8 2564 */ 2565 mcc: string; 2566 2567 /** 2568 * Indicates the mobile network code. 2569 * 2570 * @type { string } 2571 * @syscap SystemCapability.Telephony.CoreService 2572 * @systemapi Hide this for inner system use. 2573 * @since 8 2574 */ 2575 mnc: string; 2576 } 2577 2578 /** 2579 * Obtains LTE cell information. 2580 * 2581 * @interface LteCellInformation 2582 * @syscap SystemCapability.Telephony.CoreService 2583 * @systemapi Hide this for inner system use. 2584 * @since 8 2585 */ 2586 export interface LteCellInformation { 2587 /** 2588 * Indicates the cell global identification. 2589 * 2590 * @type { number } 2591 * @syscap SystemCapability.Telephony.CoreService 2592 * @systemapi Hide this for inner system use. 2593 * @since 8 2594 */ 2595 cgi: number; 2596 2597 /** 2598 * Indicates the physical cell identification. 2599 * 2600 * @type { number } 2601 * @syscap SystemCapability.Telephony.CoreService 2602 * @systemapi Hide this for inner system use. 2603 * @since 8 2604 */ 2605 pci: number; 2606 2607 /** 2608 * Indicates the tracking area code. 2609 * 2610 * @type { number } 2611 * @syscap SystemCapability.Telephony.CoreService 2612 * @systemapi Hide this for inner system use. 2613 * @since 8 2614 */ 2615 tac: number; 2616 2617 /** 2618 * Indicates the E-UTRA Absolute Radio Frequency Channel Number. 2619 * 2620 * @type { number } 2621 * @syscap SystemCapability.Telephony.CoreService 2622 * @systemapi Hide this for inner system use. 2623 * @since 8 2624 */ 2625 earfcn: number; 2626 2627 /** 2628 * Indicates the bandwidth. 2629 * 2630 * @type { number } 2631 * @syscap SystemCapability.Telephony.CoreService 2632 * @systemapi Hide this for inner system use. 2633 * @since 8 2634 */ 2635 bandwidth: number; 2636 2637 /** 2638 * Indicates the mobile country code. 2639 * 2640 * @type { string } 2641 * @syscap SystemCapability.Telephony.CoreService 2642 * @systemapi Hide this for inner system use. 2643 * @since 8 2644 */ 2645 mcc: string; 2646 2647 /** 2648 * Indicates the mobile network code. 2649 * 2650 * @type { string } 2651 * @syscap SystemCapability.Telephony.CoreService 2652 * @systemapi Hide this for inner system use. 2653 * @since 8 2654 */ 2655 mnc: string; 2656 2657 /** 2658 * Support for New Radio_Dual Connectivity. 2659 * 2660 * @type { boolean } 2661 * @syscap SystemCapability.Telephony.CoreService 2662 * @systemapi Hide this for inner system use. 2663 * @since 8 2664 */ 2665 isSupportEndc: boolean; 2666 } 2667 2668 /** 2669 * Obtains NR cell information. 2670 * 2671 * @interface NrCellInformation 2672 * @syscap SystemCapability.Telephony.CoreService 2673 * @systemapi Hide this for inner system use. 2674 * @since 8 2675 */ 2676 export interface NrCellInformation { 2677 /** 2678 * Indicates the NR-ARFCN(NR Absolute Radio Frequency Channel Number). 2679 * 2680 * @type { number } 2681 * @syscap SystemCapability.Telephony.CoreService 2682 * @systemapi Hide this for inner system use. 2683 * @since 8 2684 */ 2685 nrArfcn: number; 2686 2687 /** 2688 * Indicates the physical cell identification. 2689 * 2690 * @type { number } 2691 * @syscap SystemCapability.Telephony.CoreService 2692 * @systemapi Hide this for inner system use. 2693 * @since 8 2694 */ 2695 pci: number; 2696 2697 /** 2698 * Indicates the tracking area code. 2699 * 2700 * @type { number } 2701 * @syscap SystemCapability.Telephony.CoreService 2702 * @systemapi Hide this for inner system use. 2703 * @since 8 2704 */ 2705 tac: number; 2706 2707 /** 2708 * Indicates the 5G network cell ID. 2709 * 2710 * @type { number } 2711 * @syscap SystemCapability.Telephony.CoreService 2712 * @systemapi Hide this for inner system use. 2713 * @since 8 2714 */ 2715 nci: number; 2716 2717 /** 2718 * Indicates the mobile country code. 2719 * 2720 * @type { string } 2721 * @syscap SystemCapability.Telephony.CoreService 2722 * @systemapi Hide this for inner system use. 2723 * @since 8 2724 */ 2725 mcc: string; 2726 2727 /** 2728 * Indicates the mobile network code. 2729 * 2730 * @type { string } 2731 * @syscap SystemCapability.Telephony.CoreService 2732 * @systemapi Hide this for inner system use. 2733 * @since 8 2734 */ 2735 mnc: string; 2736 } 2737 2738 /** 2739 * Obtains TDSCDMA cell information. 2740 * 2741 * @interface TdscdmaCellInformation 2742 * @syscap SystemCapability.Telephony.CoreService 2743 * @systemapi Hide this for inner system use. 2744 * @since 8 2745 */ 2746 export interface TdscdmaCellInformation { 2747 /** 2748 * Indicates the location area code. 2749 * 2750 * @type { number } 2751 * @syscap SystemCapability.Telephony.CoreService 2752 * @systemapi Hide this for inner system use. 2753 * @since 8 2754 */ 2755 lac: number; 2756 2757 /** 2758 * Indicates the cell ID. 2759 * 2760 * @type { number } 2761 * @syscap SystemCapability.Telephony.CoreService 2762 * @systemapi Hide this for inner system use. 2763 * @since 8 2764 */ 2765 cellId: number; 2766 2767 /** 2768 * Indicates the cell parameter ID. 2769 * 2770 * @type { number } 2771 * @syscap SystemCapability.Telephony.CoreService 2772 * @systemapi Hide this for inner system use. 2773 * @since 8 2774 */ 2775 cpid: number; 2776 2777 /** 2778 * Indicates the absolute radio frequency number. 2779 * 2780 * @type { number } 2781 * @syscap SystemCapability.Telephony.CoreService 2782 * @systemapi Hide this for inner system use. 2783 * @since 8 2784 */ 2785 uarfcn: number; 2786 2787 /** 2788 * Indicates the mobile country code. 2789 * 2790 * @type { string } 2791 * @syscap SystemCapability.Telephony.CoreService 2792 * @systemapi Hide this for inner system use. 2793 * @since 8 2794 */ 2795 mcc: string; 2796 2797 /** 2798 * Indicates the mobile network code. 2799 * 2800 * @type { string } 2801 * @syscap SystemCapability.Telephony.CoreService 2802 * @systemapi Hide this for inner system use. 2803 * @since 8 2804 */ 2805 mnc: string; 2806 } 2807 2808 /** 2809 * Obtains WCDMA cell information. 2810 * 2811 * @interface WcdmaCellInformation 2812 * @syscap SystemCapability.Telephony.CoreService 2813 * @systemapi Hide this for inner system use. 2814 * @since 8 2815 */ 2816 export interface WcdmaCellInformation { 2817 /** 2818 * Indicates the location area code. 2819 * 2820 * @type { number } 2821 * @syscap SystemCapability.Telephony.CoreService 2822 * @systemapi Hide this for inner system use. 2823 * @since 8 2824 */ 2825 lac: number; 2826 2827 /** 2828 * Indicates the cell ID. 2829 * 2830 * @type { number } 2831 * @syscap SystemCapability.Telephony.CoreService 2832 * @systemapi Hide this for inner system use. 2833 * @since 8 2834 */ 2835 cellId: number; 2836 2837 /** 2838 * Indicates the primary scrambling code. 2839 * 2840 * @type { number } 2841 * @syscap SystemCapability.Telephony.CoreService 2842 * @systemapi Hide this for inner system use. 2843 * @since 8 2844 */ 2845 psc: number; 2846 2847 /** 2848 * Indicates the absolute radio frequency number. 2849 * 2850 * @type { number } 2851 * @syscap SystemCapability.Telephony.CoreService 2852 * @systemapi Hide this for inner system use. 2853 * @since 8 2854 */ 2855 uarfcn: number; 2856 2857 /** 2858 * Indicates the mobile country code. 2859 * 2860 * @type { string } 2861 * @syscap SystemCapability.Telephony.CoreService 2862 * @systemapi Hide this for inner system use. 2863 * @since 8 2864 */ 2865 mcc: string; 2866 2867 /** 2868 * Indicates the mobile network code. 2869 * 2870 * @type { string } 2871 * @syscap SystemCapability.Telephony.CoreService 2872 * @systemapi Hide this for inner system use. 2873 * @since 8 2874 */ 2875 mnc: string; 2876 } 2877 2878 /** 2879 * Obtains the option mode of NR. 2880 * 2881 * @enum { number } 2882 * @syscap SystemCapability.Telephony.CoreService 2883 * @systemapi Hide this for inner system use. 2884 * @since 8 2885 * @deprecated since 10 2886 * @useinstead telephony.radio#NROptionMode 2887 */ 2888 export enum NrOptionMode { 2889 /** 2890 * Indicates unknown NR networking mode. 2891 * 2892 * @syscap SystemCapability.Telephony.CoreService 2893 * @systemapi Hide this for inner system use. 2894 * @since 8 2895 * @deprecated since 10 2896 */ 2897 NR_OPTION_UNKNOWN, 2898 2899 /** 2900 * Indicates that the NR networking mode is NSA only. 2901 * 2902 * @syscap SystemCapability.Telephony.CoreService 2903 * @systemapi Hide this for inner system use. 2904 * @since 8 2905 * @deprecated since 10 2906 */ 2907 NR_OPTION_NSA_ONLY, 2908 2909 /** 2910 * Indicates that the NR networking mode is SA only. 2911 * 2912 * @syscap SystemCapability.Telephony.CoreService 2913 * @systemapi Hide this for inner system use. 2914 * @since 8 2915 * @deprecated since 10 2916 */ 2917 NR_OPTION_SA_ONLY, 2918 2919 /** 2920 * Indicates that the NR networking mode is NSA and SA. 2921 * 2922 * @syscap SystemCapability.Telephony.CoreService 2923 * @systemapi Hide this for inner system use. 2924 * @since 8 2925 * @deprecated since 10 2926 */ 2927 NR_OPTION_NSA_AND_SA, 2928 } 2929 2930 /** 2931 * Obtains the option mode of NR. 2932 * 2933 * @enum { number } 2934 * @syscap SystemCapability.Telephony.CoreService 2935 * @systemapi Hide this for inner system use. 2936 * @since 10 2937 */ 2938 export enum NROptionMode { 2939 /** 2940 * Indicates unknown NR networking mode. 2941 * 2942 * @syscap SystemCapability.Telephony.CoreService 2943 * @systemapi Hide this for inner system use. 2944 * @since 10 2945 */ 2946 NR_OPTION_UNKNOWN, 2947 2948 /** 2949 * Indicates that the NR networking mode is NSA only. 2950 * 2951 * @syscap SystemCapability.Telephony.CoreService 2952 * @systemapi Hide this for inner system use. 2953 * @since 10 2954 */ 2955 NR_OPTION_NSA_ONLY, 2956 2957 /** 2958 * Indicates that the NR networking mode is SA only. 2959 * 2960 * @syscap SystemCapability.Telephony.CoreService 2961 * @systemapi Hide this for inner system use. 2962 * @since 10 2963 */ 2964 NR_OPTION_SA_ONLY, 2965 2966 /** 2967 * Indicates that the NR networking mode is NSA and SA. 2968 * 2969 * @syscap SystemCapability.Telephony.CoreService 2970 * @systemapi Hide this for inner system use. 2971 * @since 10 2972 */ 2973 NR_OPTION_NSA_AND_SA, 2974 } 2975 2976 /** 2977 * Obtains the network search results. 2978 * 2979 * @interface NetworkSearchResult 2980 * @syscap SystemCapability.Telephony.CoreService 2981 * @systemapi Hide this for inner system use. 2982 * @since 6 2983 */ 2984 export interface NetworkSearchResult { 2985 /** 2986 * Indicates whether the network search was successful. 2987 * 2988 * @type { boolean } 2989 * @syscap SystemCapability.Telephony.CoreService 2990 * @systemapi Hide this for inner system use. 2991 * @since 6 2992 */ 2993 isNetworkSearchSuccess: boolean; 2994 2995 /** 2996 * Obtains the network search results. 2997 * 2998 * @type { Array<NetworkInformation> } 2999 * @syscap SystemCapability.Telephony.CoreService 3000 * @systemapi Hide this for inner system use. 3001 * @since 6 3002 */ 3003 networkSearchResult: Array<NetworkInformation>; 3004 } 3005 3006 /** 3007 * Obtains the network information. 3008 * 3009 * @interface NetworkInformation 3010 * @syscap SystemCapability.Telephony.CoreService 3011 * @systemapi Hide this for inner system use. 3012 * @since 6 3013 */ 3014 export interface NetworkInformation { 3015 /** 3016 * Indicates the name of the operator. 3017 * 3018 * @type { string } 3019 * @syscap SystemCapability.Telephony.CoreService 3020 * @systemapi Hide this for inner system use. 3021 * @since 6 3022 */ 3023 operatorName: string; 3024 3025 /** 3026 * Indicates the number of the operator. 3027 * 3028 * @type { string } 3029 * @syscap SystemCapability.Telephony.CoreService 3030 * @systemapi Hide this for inner system use. 3031 * @since 6 3032 */ 3033 operatorNumeric: string; 3034 3035 /** 3036 * Indicates the status of network information. 3037 * 3038 * @type { NetworkInformationState } 3039 * @syscap SystemCapability.Telephony.CoreService 3040 * @systemapi Hide this for inner system use. 3041 * @since 6 3042 */ 3043 state: NetworkInformationState; 3044 3045 /** 3046 * Indicates the radio Technology. 3047 * 3048 * @type { string } 3049 * @syscap SystemCapability.Telephony.CoreService 3050 * @systemapi Hide this for inner system use. 3051 * @since 6 3052 */ 3053 radioTech: string; 3054 } 3055 3056 /** 3057 * Obtains network information status. 3058 * 3059 * @enum { number } 3060 * @syscap SystemCapability.Telephony.CoreService 3061 * @systemapi Hide this for inner system use. 3062 * @since 6 3063 */ 3064 export enum NetworkInformationState { 3065 /** 3066 * Indicates that the network state is unknown. 3067 * 3068 * @syscap SystemCapability.Telephony.CoreService 3069 * @systemapi Hide this for inner system use. 3070 * @since 6 3071 */ 3072 NETWORK_UNKNOWN, 3073 3074 /** 3075 * Indicates that the network is available for registration. 3076 * 3077 * @syscap SystemCapability.Telephony.CoreService 3078 * @systemapi Hide this for inner system use. 3079 * @since 6 3080 */ 3081 NETWORK_AVAILABLE, 3082 3083 /** 3084 * Indicates that you have already registered with the network. 3085 * 3086 * @syscap SystemCapability.Telephony.CoreService 3087 * @systemapi Hide this for inner system use. 3088 * @since 6 3089 */ 3090 NETWORK_CURRENT, 3091 3092 /** 3093 * Indicates that the network is unavailable for registration. 3094 * 3095 * @syscap SystemCapability.Telephony.CoreService 3096 * @systemapi Hide this for inner system use. 3097 * @since 6 3098 */ 3099 NETWORK_FORBIDDEN 3100 } 3101 3102 /** 3103 * Obtains the network selection mode option. 3104 * 3105 * @interface NetworkSelectionModeOptions 3106 * @syscap SystemCapability.Telephony.CoreService 3107 * @systemapi Hide this for inner system use. 3108 * @since 6 3109 */ 3110 export interface NetworkSelectionModeOptions { 3111 /** 3112 * Indicates the card slot index number, ranging from 0 to 3113 * the maximum card slot index number supported by the device. 3114 * 3115 * @type { number } 3116 * @syscap SystemCapability.Telephony.CoreService 3117 * @systemapi Hide this for inner system use. 3118 * @since 6 3119 */ 3120 slotId: number; 3121 3122 /** 3123 * Indicates the network search mode of the SIM card. 3124 * 3125 * @type { NetworkSelectionMode } 3126 * @syscap SystemCapability.Telephony.CoreService 3127 * @systemapi Hide this for inner system use. 3128 * @since 6 3129 */ 3130 selectMode: NetworkSelectionMode; 3131 3132 /** 3133 * Indicates the network information. 3134 * 3135 * @type { NetworkInformation } 3136 * @syscap SystemCapability.Telephony.CoreService 3137 * @systemapi Hide this for inner system use. 3138 * @since 6 3139 */ 3140 networkInformation: NetworkInformation; 3141 3142 /** 3143 * Indicates whether to continue selecting the network selection mode. 3144 * 3145 * @type { boolean } 3146 * @syscap SystemCapability.Telephony.CoreService 3147 * @systemapi Hide this for inner system use. 3148 * @since 6 3149 */ 3150 resumeSelection: boolean; 3151 } 3152 3153 /** 3154 * Obtains the network selection mode. 3155 * 3156 * @enum { number } 3157 * @syscap SystemCapability.Telephony.CoreService 3158 * @since 6 3159 */ 3160 export enum NetworkSelectionMode { 3161 /** 3162 * Indicates that the network is unavailable for registration. 3163 * 3164 * @syscap SystemCapability.Telephony.CoreService 3165 * @since 6 3166 */ 3167 NETWORK_SELECTION_UNKNOWN, 3168 3169 /** 3170 * Indicates that the network is unavailable for registration. 3171 * 3172 * @syscap SystemCapability.Telephony.CoreService 3173 * @since 6 3174 */ 3175 NETWORK_SELECTION_AUTOMATIC, 3176 3177 /** 3178 * Manual network selection modes. 3179 * 3180 * @syscap SystemCapability.Telephony.CoreService 3181 * @since 6 3182 */ 3183 NETWORK_SELECTION_MANUAL 3184 } 3185 3186 /** 3187 * Obtains IMS registration status. 3188 * 3189 * @enum { number } 3190 * @syscap SystemCapability.Telephony.CoreService 3191 * @systemapi Hide this for inner system use. 3192 * @since 9 3193 */ 3194 export enum ImsRegState { 3195 /** 3196 * Indicates that the ims service is not registered. 3197 * 3198 * @syscap SystemCapability.Telephony.CoreService 3199 * @systemapi Hide this for inner system use. 3200 * @since 9 3201 */ 3202 IMS_UNREGISTERED, 3203 3204 /** 3205 * Indicates that the ims service has been registered. 3206 * 3207 * @syscap SystemCapability.Telephony.CoreService 3208 * @systemapi Hide this for inner system use. 3209 * @since 9 3210 */ 3211 IMS_REGISTERED, 3212 } 3213 3214 /** 3215 * Indicates IMS registration technology. 3216 * 3217 * @enum { number } 3218 * @syscap SystemCapability.Telephony.CoreService 3219 * @systemapi Hide this for inner system use. 3220 * @since 9 3221 */ 3222 export enum ImsRegTech { 3223 /** 3224 * Indicates that ims has no registered technology. 3225 * 3226 * @syscap SystemCapability.Telephony.CoreService 3227 * @systemapi Hide this for inner system use. 3228 * @since 9 3229 */ 3230 REGISTRATION_TECH_NONE, 3231 3232 /** 3233 * Indicates that ims registers LTE technology. 3234 * 3235 * @syscap SystemCapability.Telephony.CoreService 3236 * @systemapi Hide this for inner system use. 3237 * @since 9 3238 */ 3239 REGISTRATION_TECH_LTE, 3240 3241 /** 3242 * Indicates that ims registers IWLAN technology. 3243 * 3244 * @syscap SystemCapability.Telephony.CoreService 3245 * @systemapi Hide this for inner system use. 3246 * @since 9 3247 */ 3248 REGISTRATION_TECH_IWLAN, 3249 3250 /** 3251 * Indicates that ims registers NR technology. 3252 * 3253 * @syscap SystemCapability.Telephony.CoreService 3254 * @systemapi Hide this for inner system use. 3255 * @since 9 3256 */ 3257 REGISTRATION_TECH_NR, 3258 } 3259 3260 /** 3261 * Indicates IMS registration information. 3262 * 3263 * @interface ImsRegInfo 3264 * @syscap SystemCapability.Telephony.CoreService 3265 * @systemapi Hide this for inner system use. 3266 * @since 9 3267 */ 3268 export interface ImsRegInfo { 3269 /** 3270 * Indicates the registration status of the ims service. 3271 * 3272 * @type { ImsRegState } 3273 * @syscap SystemCapability.Telephony.CoreService 3274 * @systemapi Hide this for inner system use. 3275 * @since 9 3276 */ 3277 imsRegState: ImsRegState; 3278 3279 /** 3280 * Indicates the mode of ims radio technology. 3281 * 3282 * @type { ImsRegTech } 3283 * @syscap SystemCapability.Telephony.CoreService 3284 * @systemapi Hide this for inner system use. 3285 * @since 9 3286 */ 3287 imsRegTech: ImsRegTech; 3288 } 3289 3290 /** 3291 * Indicates the type of IMS service. 3292 * 3293 * @enum { number } 3294 * @syscap SystemCapability.Telephony.CoreService 3295 * @systemapi Hide this for inner system use. 3296 * @since 9 3297 */ 3298 export enum ImsServiceType { 3299 /** 3300 * Indicates voice service. 3301 * 3302 * @syscap SystemCapability.Telephony.CoreService 3303 * @systemapi Hide this for inner system use. 3304 * @since 9 3305 */ 3306 TYPE_VOICE, 3307 3308 /** 3309 * Indicates video service. 3310 * 3311 * @syscap SystemCapability.Telephony.CoreService 3312 * @systemapi Hide this for inner system use. 3313 * @since 9 3314 */ 3315 TYPE_VIDEO, 3316 3317 /** 3318 * Indicates UT service. 3319 * 3320 * @syscap SystemCapability.Telephony.CoreService 3321 * @systemapi Hide this for inner system use. 3322 * @since 9 3323 */ 3324 TYPE_UT, 3325 3326 /** 3327 * Indicates SMS service. 3328 * 3329 * @syscap SystemCapability.Telephony.CoreService 3330 * @systemapi Hide this for inner system use. 3331 * @since 9 3332 */ 3333 TYPE_SMS, 3334 } 3335 3336 /** 3337 * Enum for network capability type. 3338 * 3339 * @enum { number } 3340 * @syscap SystemCapability.Telephony.CoreService 3341 * @systemapi Hide this for inner system use. 3342 * @since 10 3343 */ 3344 export enum NetworkCapabilityType { 3345 /** 3346 * Indicates LTE network switch type. 3347 * 3348 * @syscap SystemCapability.Telephony.CoreService 3349 * @systemapi Hide this for inner system use. 3350 * @since 10 3351 */ 3352 SERVICE_TYPE_LTE, 3353 3354 /** 3355 * Indicates NR network switch type. 3356 * 3357 * @syscap SystemCapability.Telephony.CoreService 3358 * @systemapi Hide this for inner system use. 3359 * @since 10 3360 */ 3361 SERVICE_TYPE_NR, 3362 } 3363 3364 /** 3365 * Enum for network capability state. 3366 * 3367 * @enum { number } 3368 * @syscap SystemCapability.Telephony.CoreService 3369 * @systemapi Hide this for inner system use. 3370 * @since 10 3371 */ 3372 export enum NetworkCapabilityState { 3373 /** 3374 * Indicates turn off network switch. 3375 * 3376 * @syscap SystemCapability.Telephony.CoreService 3377 * @systemapi Hide this for inner system use. 3378 * @since 10 3379 */ 3380 SERVICE_CAPABILITY_OFF, 3381 3382 /** 3383 * Indicates turn on network switch. 3384 * 3385 * @syscap SystemCapability.Telephony.CoreService 3386 * @systemapi Hide this for inner system use. 3387 * @since 10 3388 */ 3389 SERVICE_CAPABILITY_ON, 3390 } 3391} 3392 3393export default radio; 3394