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