1/* 2 * Copyright (C) 2021-2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16/** 17 * @file 18 * @kit TelephonyKit 19 */ 20 21import type { AsyncCallback } from './@ohos.base'; 22 23/** 24 * Provides methods related to cellular data services. 25 * 26 * @namespace data 27 * @syscap SystemCapability.Telephony.CellularData 28 * @since 7 29 */ 30declare namespace data { 31 /** 32 * Get the default cellular data card. 33 * 34 * @param { AsyncCallback<number> } callback - Indicates the default cellular data slot id. 35 * @syscap SystemCapability.Telephony.CellularData 36 * @since 7 37 */ 38 function getDefaultCellularDataSlotId(callback: AsyncCallback<number>): void; 39 40 /** 41 * Get the default cellular data card. 42 * 43 * @returns { Promise<number> } Returns the default cellular data slot id. 44 * @syscap SystemCapability.Telephony.CellularData 45 * @since 7 46 */ 47 function getDefaultCellularDataSlotId(): Promise<number>; 48 49 /** 50 * Get the default cellular data card. 51 * 52 * @returns { number } Returns default cellular data slot id. 53 * @syscap SystemCapability.Telephony.CellularData 54 * @since 9 55 */ 56 function getDefaultCellularDataSlotIdSync(): number; 57 58 /** 59 * Switch cellular data services to another card, without changing the default settings. 60 * 61 * @permission ohos.permission.SET_TELEPHONY_STATE 62 * @param { number } slotId - Indicates the ID of the target card slot. 63 * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. 64 * @param { AsyncCallback<void> } callback - The callback of setDefaultCellularDataSlotId. 65 * @throws { BusinessError } 201 - Permission denied. 66 * @throws { BusinessError } 202 - Non-system applications use system APIs. 67 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 68 * 2. Incorrect parameter types. 69 * @throws { BusinessError } 8300001 - Invalid parameter value. 70 * @throws { BusinessError } 8300002 - Service connection failed. 71 * @throws { BusinessError } 8300003 - System internal error. 72 * @throws { BusinessError } 8300004 - No SIM card found. 73 * @throws { BusinessError } 8300999 - Unknown error. 74 * @throws { BusinessError } 8301001 - SIM card is not activated. 75 * @syscap SystemCapability.Telephony.CellularData 76 * @systemapi Hide this for inner system use. 77 * @since 7 78 */ 79 function setDefaultCellularDataSlotId(slotId: number, callback: AsyncCallback<void>): void; 80 81 /** 82 * Switch cellular data services to another card, without changing the default settings. 83 * 84 * @permission ohos.permission.SET_TELEPHONY_STATE 85 * @param { number } slotId - Indicates the ID of the target card slot. 86 * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. 87 * @returns { Promise<void> } The promise returned by the setDefaultCellularDataSlotId. 88 * @throws { BusinessError } 201 - Permission denied. 89 * @throws { BusinessError } 202 - Non-system applications use system APIs. 90 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 91 * 2. Incorrect parameter types. 92 * @throws { BusinessError } 8300001 - Invalid parameter value. 93 * @throws { BusinessError } 8300002 - Service connection failed. 94 * @throws { BusinessError } 8300003 - System internal error. 95 * @throws { BusinessError } 8300004 - No SIM card found. 96 * @throws { BusinessError } 8300999 - Unknown error. 97 * @throws { BusinessError } 8301001 - SIM card is not activated. 98 * @syscap SystemCapability.Telephony.CellularData 99 * @systemapi Hide this for inner system use. 100 * @since 7 101 */ 102 function setDefaultCellularDataSlotId(slotId: number): Promise<void>; 103 104 /** 105 * Indicates that there is no uplink or downlink data. 106 * 107 * <p>It is a return value of service state query of cellular data services. 108 * @param { AsyncCallback<DataFlowType> } callback - Indicates the data flow type. 109 * @syscap SystemCapability.Telephony.CellularData 110 * @since 7 111 */ 112 function getCellularDataFlowType(callback: AsyncCallback<DataFlowType>): void; 113 114 /** 115 * Indicates that there is no uplink or downlink data. 116 * 117 * <p>It is a return value of service state query of cellular data services. 118 * @returns { Promise<DataFlowType> } Returns the data flow type. 119 * @syscap SystemCapability.Telephony.CellularData 120 * @since 7 121 */ 122 function getCellularDataFlowType(): Promise<DataFlowType>; 123 124 /** 125 * Obtain the connection state of the PS domain. 126 * 127 * @param { AsyncCallback<DataConnectState> } callback - Indicates the callback for getting the connection state, 128 * which can be any of the following: 129 * <ul> 130 * <li>{@code DataConnectState#DATA_STATE_UNKNOWN} 131 * <li>{@code DataConnectState#DATA_STATE_DISCONNECTED} 132 * <li>{@code DataConnectState#DATA_STATE_CONNECTING} 133 * <li>{@code DataConnectState#DATA_STATE_CONNECTED} 134 * <li>{@code DataConnectState#DATA_STATE_SUSPENDED} 135 * </ul> 136 * @syscap SystemCapability.Telephony.CellularData 137 * @since 7 138 */ 139 function getCellularDataState(callback: AsyncCallback<DataConnectState>): void; 140 141 /** 142 * Obtain the connection state of the PS domain. 143 * 144 * @returns { Promise<DataConnectState> } Returns the connection state, which can be any of the following: 145 * <ul> 146 * <li>{@code DataConnectState#DATA_STATE_UNKNOWN} 147 * <li>{@code DataConnectState#DATA_STATE_DISCONNECTED} 148 * <li>{@code DataConnectState#DATA_STATE_CONNECTING} 149 * <li>{@code DataConnectState#DATA_STATE_CONNECTED} 150 * <li>{@code DataConnectState#DATA_STATE_SUSPENDED} 151 * </ul> 152 * @syscap SystemCapability.Telephony.CellularData 153 * @since 7 154 */ 155 function getCellularDataState(): Promise<DataConnectState>; 156 157 /** 158 * Check whether cellular data services are enabled. 159 * 160 * @permission ohos.permission.GET_NETWORK_INFO 161 * @param { AsyncCallback<boolean> } callback - Indicates the callback for checking whether cellular data services 162 * are enabled. Returns {@code true} if cellular data services are enabled; returns {@code false} otherwise. 163 * @throws { BusinessError } 201 - Permission denied. 164 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 165 * 2. Incorrect parameter types. 166 * @throws { BusinessError } 8300001 - Invalid parameter value. 167 * @throws { BusinessError } 8300002 - Service connection failed. 168 * @throws { BusinessError } 8300003 - System internal error. 169 * @throws { BusinessError } 8300999 - Unknown error. 170 * @syscap SystemCapability.Telephony.CellularData 171 * @since 7 172 */ 173 function isCellularDataEnabled(callback: AsyncCallback<boolean>): void; 174 175 /** 176 * Check whether cellular data services are enabled. 177 * 178 * @permission ohos.permission.GET_NETWORK_INFO 179 * @returns { Promise<boolean> } Returns {@code true} if cellular data services are enabled. 180 * Returns {@code false} otherwise. 181 * @throws { BusinessError } 201 - Permission denied. 182 * @throws { BusinessError } 8300002 - Service connection failed. 183 * @throws { BusinessError } 8300003 - System internal error. 184 * @throws { BusinessError } 8300999 - Unknown error. 185 * @syscap SystemCapability.Telephony.CellularData 186 * @since 7 187 */ 188 function isCellularDataEnabled(): Promise<boolean>; 189 190 /** 191 * Check whether cellular data services are enabled. 192 * 193 * @permission ohos.permission.GET_NETWORK_INFO 194 * @returns { boolean } Returns {@code true} if cellular data services are enabled. 195 * Returns {@code false} otherwise. 196 * @throws { BusinessError } 201 - Permission denied. 197 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 198 * @throws { BusinessError } 8300003 - System internal error. 199 * @throws { BusinessError } 8300999 - Unknown error code. 200 * @syscap SystemCapability.Telephony.CellularData 201 * @since 12 202 */ 203 function isCellularDataEnabledSync(): boolean; 204 205 /** 206 * Enable cellular data services. 207 * 208 * @permission ohos.permission.SET_TELEPHONY_STATE 209 * @param { AsyncCallback<void> } callback - The callback of enableCellularData. 210 * @throws { BusinessError } 201 - Permission denied. 211 * @throws { BusinessError } 202 - Non-system applications use system APIs. 212 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 213 * 2. Incorrect parameter types. 214 * @throws { BusinessError } 8300001 - Invalid parameter value. 215 * @throws { BusinessError } 8300002 - Service connection failed. 216 * @throws { BusinessError } 8300003 - System internal error. 217 * @throws { BusinessError } 8300999 - Unknown error. 218 * @syscap SystemCapability.Telephony.CellularData 219 * @systemapi Hide this for inner system use. 220 * @since 7 221 */ 222 function enableCellularData(callback: AsyncCallback<void>): void; 223 224 /** 225 * Enable cellular data services. 226 * 227 * @permission ohos.permission.SET_TELEPHONY_STATE 228 * @returns { Promise<void> } The promise returned by the enableCellularData. 229 * @throws { BusinessError } 201 - Permission denied. 230 * @throws { BusinessError } 202 - Non-system applications use system APIs. 231 * @throws { BusinessError } 8300002 - Service connection failed. 232 * @throws { BusinessError } 8300003 - System internal error. 233 * @throws { BusinessError } 8300999 - Unknown error. 234 * @syscap SystemCapability.Telephony.CellularData 235 * @systemapi Hide this for inner system use. 236 * @since 7 237 */ 238 function enableCellularData(): Promise<void>; 239 240 /** 241 * Disable cellular data services. 242 * 243 * @permission ohos.permission.SET_TELEPHONY_STATE 244 * @param { AsyncCallback<void> } callback - The callback of disableCellularData. 245 * @throws { BusinessError } 201 - Permission denied. 246 * @throws { BusinessError } 202 - Non-system applications use system APIs. 247 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 248 * 2. Incorrect parameter types. 249 * @throws { BusinessError } 8300001 - Invalid parameter value. 250 * @throws { BusinessError } 8300002 - Service connection failed. 251 * @throws { BusinessError } 8300003 - System internal error. 252 * @throws { BusinessError } 8300999 - Unknown error. 253 * @syscap SystemCapability.Telephony.CellularData 254 * @systemapi Hide this for inner system use. 255 * @since 7 256 */ 257 function disableCellularData(callback: AsyncCallback<void>): void; 258 259 /** 260 * Disable cellular data services. 261 * 262 * @permission ohos.permission.SET_TELEPHONY_STATE 263 * @returns { Promise<void> } The promise returned by the disableCellularData. 264 * @throws { BusinessError } 201 - Permission denied. 265 * @throws { BusinessError } 202 - Non-system applications use system APIs. 266 * @throws { BusinessError } 8300002 - Service connection failed. 267 * @throws { BusinessError } 8300003 - System internal error. 268 * @throws { BusinessError } 8300999 - Unknown error. 269 * @syscap SystemCapability.Telephony.CellularData 270 * @systemapi Hide this for inner system use. 271 * @since 7 272 */ 273 function disableCellularData(): Promise<void>; 274 275 /** 276 * Check whether roaming is enabled for cellular data services. 277 * 278 * @permission ohos.permission.GET_NETWORK_INFO 279 * @param { number } slotId - Indicates the ID of a card slot. 280 * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. 281 * @param { AsyncCallback<boolean> } callback - Indicates the callback for checking whether roaming is enabled 282 * for cellular data services. Returns {@code true} if roaming is enabled for cellular data services; 283 * returns {@code false} otherwise. 284 * @throws { BusinessError } 201 - Permission denied. 285 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 286 * 2. Incorrect parameter types. 287 * @throws { BusinessError } 8300001 - Invalid parameter value. 288 * @throws { BusinessError } 8300002 - Service connection failed. 289 * @throws { BusinessError } 8300003 - System internal error. 290 * @throws { BusinessError } 8300999 - Unknown error. 291 * @syscap SystemCapability.Telephony.CellularData 292 * @since 7 293 */ 294 function isCellularDataRoamingEnabled(slotId: number, callback: AsyncCallback<boolean>): void; 295 296 /** 297 * Check whether roaming is enabled for cellular data services. 298 * 299 * @permission ohos.permission.GET_NETWORK_INFO 300 * @param { number } slotId - Indicates the ID of a card slot. 301 * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. 302 * @returns { Promise<boolean> } Returns {@code true} if roaming is enabled for cellular data services. 303 * Returns {@code false} otherwise. 304 * @throws { BusinessError } 201 - Permission denied. 305 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 306 * 2. Incorrect parameter types. 307 * @throws { BusinessError } 8300001 - Invalid parameter value. 308 * @throws { BusinessError } 8300002 - Service connection failed. 309 * @throws { BusinessError } 8300003 - System internal error. 310 * @throws { BusinessError } 8300999 - Unknown error. 311 * @syscap SystemCapability.Telephony.CellularData 312 * @since 7 313 */ 314 function isCellularDataRoamingEnabled(slotId: number): Promise<boolean>; 315 316 /** 317 * Check whether roaming is enabled for cellular data services. 318 * 319 * @permission ohos.permission.GET_NETWORK_INFO 320 * @param { number } slotId - Indicates the ID of a card slot. 321 * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. 322 * @returns { boolean } Returns {@code true} if roaming is enabled for cellular data services. 323 * Returns {@code false} otherwise. 324 * @throws { BusinessError } 201 - Permission denied. 325 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 326 * 2. Incorrect parameters types; 327 * @throws { BusinessError } 8300001 - Invalid parameter value. 328 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 329 * @throws { BusinessError } 8300003 - System internal error. 330 * @throws { BusinessError } 8300999 - Unknown error code. 331 * @syscap SystemCapability.Telephony.CellularData 332 * @since 12 333 */ 334 function isCellularDataRoamingEnabledSync(slotId: number): boolean; 335 336 /** 337 * Enable cellular data roaming. 338 * 339 * @permission ohos.permission.SET_TELEPHONY_STATE 340 * @param { number } slotId - Indicates the ID of a card slot. 341 * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. 342 * @param { AsyncCallback<void> } callback - The callback of enableCellularDataRoaming. 343 * @throws { BusinessError } 201 - Permission denied. 344 * @throws { BusinessError } 202 - Non-system applications use system APIs. 345 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 346 * 2. Incorrect parameter types. 347 * @throws { BusinessError } 8300001 - Invalid parameter value. 348 * @throws { BusinessError } 8300002 - Service connection failed. 349 * @throws { BusinessError } 8300003 - System internal error. 350 * @throws { BusinessError } 8300999 - Unknown error. 351 * @syscap SystemCapability.Telephony.CellularData 352 * @systemapi Hide this for inner system use. 353 * @since 7 354 */ 355 function enableCellularDataRoaming(slotId: number, callback: AsyncCallback<void>): void; 356 357 /** 358 * Enable cellular data roaming. 359 * 360 * @permission ohos.permission.SET_TELEPHONY_STATE 361 * @param { number } slotId - Indicates the ID of a card slot. 362 * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. 363 * @returns { Promise<void> } The promise returned by the enableCellularDataRoaming. 364 * @throws { BusinessError } 201 - Permission denied. 365 * @throws { BusinessError } 202 - Non-system applications use system APIs. 366 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 367 * 2. Incorrect parameter types. 368 * @throws { BusinessError } 8300001 - Invalid parameter value. 369 * @throws { BusinessError } 8300002 - Service connection failed. 370 * @throws { BusinessError } 8300003 - System internal error. 371 * @throws { BusinessError } 8300999 - Unknown error. 372 * @syscap SystemCapability.Telephony.CellularData 373 * @systemapi Hide this for inner system use. 374 * @since 7 375 */ 376 function enableCellularDataRoaming(slotId: number): Promise<void>; 377 378 /** 379 * Disable cellular data roaming. 380 * 381 * @permission ohos.permission.SET_TELEPHONY_STATE 382 * @param { number } slotId - Indicates the ID of a card slot. 383 * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. 384 * @param { AsyncCallback<void> } callback - The callback of disableCellularDataRoaming. 385 * @throws { BusinessError } 201 - Permission denied. 386 * @throws { BusinessError } 202 - Non-system applications use system APIs. 387 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 388 * 2. Incorrect parameter types. 389 * @throws { BusinessError } 8300001 - Invalid parameter value. 390 * @throws { BusinessError } 8300002 - Service connection failed. 391 * @throws { BusinessError } 8300003 - System internal error. 392 * @throws { BusinessError } 8300999 - Unknown error. 393 * @syscap SystemCapability.Telephony.CellularData 394 * @systemapi Hide this for inner system use. 395 * @since 7 396 */ 397 function disableCellularDataRoaming(slotId: number, callback: AsyncCallback<void>): void; 398 399 /** 400 * Disable cellular data roaming. 401 * 402 * @permission ohos.permission.SET_TELEPHONY_STATE 403 * @param { number } slotId - Indicates the ID of a card slot. 404 * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. 405 * @returns { Promise<void> } The promise returned by the disableCellularDataRoaming. 406 * @throws { BusinessError } 201 - Permission denied. 407 * @throws { BusinessError } 202 - Non-system applications use system APIs. 408 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 409 * 2. Incorrect parameter types. 410 * @throws { BusinessError } 8300001 - Invalid parameter value. 411 * @throws { BusinessError } 8300002 - Service connection failed. 412 * @throws { BusinessError } 8300003 - System internal error. 413 * @throws { BusinessError } 8300999 - Unknown error. 414 * @syscap SystemCapability.Telephony.CellularData 415 * @systemapi Hide this for inner system use. 416 * @since 7 417 */ 418 function disableCellularDataRoaming(slotId: number): Promise<void>; 419 420 /** 421 * Obtains the default cellular data SIM ID. 422 * 423 * @returns { number } Returns the SIM ID of the default cellular data sim and SIM ID will increase from 1. 424 * @syscap SystemCapability.Telephony.CellularData 425 * @since 10 426 */ 427 function getDefaultCellularDataSimId(): number; 428 429 /** 430 * Query all APN info. 431 * 432 * @permission ohos.permission.MANAGE_APN_SETTING 433 * @returns { Promise<Array<ApnInfo>> } Returns all APN info of default cellular data card. 434 * @throws { BusinessError } 201 - Permission denied. 435 * @syscap SystemCapability.Telephony.CellularData 436 * @since 16 437 */ 438 function queryAllApns(): Promise<Array<ApnInfo>>; 439 440 /** 441 * Query APN IDs. 442 * 443 * @permission ohos.permission.MANAGE_APN_SETTING 444 * @param { ApnInfo } apnInfo - The APN information that needs to be queried. 445 * @returns { Promise<Array<number>> } Returns IDs of all APNs that meet the query conditions. 446 * @throws { BusinessError } 201 - Permission denied. 447 * @syscap SystemCapability.Telephony.CellularData 448 * @since 16 449 */ 450 function queryApnIds(apnInfo: ApnInfo): Promise<Array<number>>; 451 452 /** 453 * Set preferred APN. 454 * 455 * @permission ohos.permission.MANAGE_APN_SETTING 456 * @param { number } apnId - The APN ID which is used to be set. 457 * @returns { Promise<boolean> } Returns {@code true} if preferred APN set success; returns {@code false} otherwise. 458 * @throws { BusinessError } 201 - Permission denied. 459 * @syscap SystemCapability.Telephony.CellularData 460 * @since 16 461 */ 462 function setPreferredApn(apnId: number): Promise<boolean>; 463 464 /** 465 * Defines the APN info. 466 * 467 * @interface ApnInfo 468 * @syscap SystemCapability.Telephony.CellularData 469 * @since 16 470 */ 471 interface ApnInfo { 472 /** 473 * Indicates APN name. 474 * 475 * @type { string } 476 * @syscap SystemCapability.Telephony.CellularData 477 * @since 16 478 */ 479 apnName: string; 480 /** 481 * Indicates APN. 482 * 483 * @type { string } 484 * @syscap SystemCapability.Telephony.CellularData 485 * @since 16 486 */ 487 apn: string; 488 /** 489 * Indicates APN mcc. 490 * 491 * @type { string } 492 * @syscap SystemCapability.Telephony.CellularData 493 * @since 16 494 */ 495 mcc: string; 496 /** 497 * Indicates APN mcc. 498 * 499 * @type { string } 500 * @syscap SystemCapability.Telephony.CellularData 501 * @since 16 502 */ 503 mnc: string; 504 /** 505 * Indicates APN user. 506 * 507 * @type { ?string } 508 * @syscap SystemCapability.Telephony.CellularData 509 * @since 16 510 */ 511 user?: string; 512 /** 513 * Indicates APN type. 514 * 515 * @type { ?string } 516 * @syscap SystemCapability.Telephony.CellularData 517 * @since 16 518 */ 519 type?: string; 520 /** 521 * Indicates APN proxy. 522 * 523 * @type { ?string } 524 * @syscap SystemCapability.Telephony.CellularData 525 * @since 16 526 */ 527 proxy?: string; 528 /** 529 * Indicates APN mmsproxy. 530 * 531 * @type { ?string } 532 * @syscap SystemCapability.Telephony.CellularData 533 * @since 16 534 */ 535 mmsproxy?: string; 536 } 537 538 /** 539 * Describes the cellular data flow type. 540 * 541 * @enum { number } 542 * @syscap SystemCapability.Telephony.CellularData 543 * @since 7 544 */ 545 export enum DataFlowType { 546 /** 547 * Indicates that there is no uplink or downlink data. 548 * 549 * @syscap SystemCapability.Telephony.CellularData 550 * @since 7 551 */ 552 DATA_FLOW_TYPE_NONE = 0, 553 554 /** 555 * Indicates that there is only downlink data. 556 * 557 * @syscap SystemCapability.Telephony.CellularData 558 * @since 7 559 */ 560 DATA_FLOW_TYPE_DOWN = 1, 561 562 /** 563 * Indicates that there is only uplink data. 564 * 565 * @syscap SystemCapability.Telephony.CellularData 566 * @since 7 567 */ 568 DATA_FLOW_TYPE_UP = 2, 569 570 /** 571 * Indicates that there is uplink and downlink data. 572 * 573 * @syscap SystemCapability.Telephony.CellularData 574 * @since 7 575 */ 576 DATA_FLOW_TYPE_UP_DOWN = 3, 577 578 /** 579 * Indicates that there is no uplink or downlink data, and the bottom-layer link is in the dormant state. 580 * 581 * @syscap SystemCapability.Telephony.CellularData 582 * @since 7 583 */ 584 DATA_FLOW_TYPE_DORMANT = 4 585 } 586 587 /** 588 * Describes the cellular data link connection state. 589 * 590 * @enum { number } 591 * @syscap SystemCapability.Telephony.CellularData 592 * @since 7 593 */ 594 export enum DataConnectState { 595 /** 596 * Indicates that a cellular data link is unknown. 597 * 598 * @syscap SystemCapability.Telephony.CellularData 599 * @since 7 600 */ 601 DATA_STATE_UNKNOWN = -1, 602 603 /** 604 * Indicates that a cellular data link is disconnected. 605 * 606 * @syscap SystemCapability.Telephony.CellularData 607 * @since 7 608 */ 609 DATA_STATE_DISCONNECTED = 0, 610 611 /** 612 * Indicates that a cellular data link is being connected. 613 * 614 * @syscap SystemCapability.Telephony.CellularData 615 * @since 7 616 */ 617 DATA_STATE_CONNECTING = 1, 618 619 /** 620 * Indicates that a cellular data link is connected. 621 * 622 * @syscap SystemCapability.Telephony.CellularData 623 * @since 7 624 */ 625 DATA_STATE_CONNECTED = 2, 626 627 /** 628 * Indicates that a cellular data link is suspended. 629 * 630 * @syscap SystemCapability.Telephony.CellularData 631 * @since 7 632 */ 633 DATA_STATE_SUSPENDED = 3 634 } 635} 636 637export default data; 638