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