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 - Internal 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 - Internal 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 - Internal 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 - Internal 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 - Internal error. 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 - Internal 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 - Internal 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 - Internal 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 - Internal 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 - Internal 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 - Internal 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 - Internal error. 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 - Internal 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 - Internal 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 - Internal 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 - Internal 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 * Get Active APN's Name. 442 * 443 * @permission ohos.permission.GET_NETWORK_INFO 444 * @returns { Promise<string> } Returns the name of the active APN or null if cellular network is not active. 445 * @throws { BusinessError } 201 - Permission denied. 446 * @syscap SystemCapability.Telephony.CellularData 447 * @since 20 448 */ 449 function getActiveApnName(): Promise<string>; 450 451 /** 452 * Query APN IDs. 453 * 454 * @permission ohos.permission.MANAGE_APN_SETTING 455 * @param { ApnInfo } apnInfo - The APN information that needs to be queried. 456 * @returns { Promise<Array<number>> } Returns IDs of all APNs that meet the query conditions. 457 * @throws { BusinessError } 201 - Permission denied. 458 * @syscap SystemCapability.Telephony.CellularData 459 * @since 16 460 */ 461 function queryApnIds(apnInfo: ApnInfo): Promise<Array<number>>; 462 463 /** 464 * Set preferred APN. 465 * 466 * @permission ohos.permission.MANAGE_APN_SETTING 467 * @param { number } apnId - The APN ID which is used to be set. 468 * @returns { Promise<boolean> } Returns {@code true} if preferred APN set success; returns {@code false} otherwise. 469 * @throws { BusinessError } 201 - Permission denied. 470 * @syscap SystemCapability.Telephony.CellularData 471 * @since 16 472 */ 473 function setPreferredApn(apnId: number): Promise<boolean>; 474 475 /** 476 * Defines the APN info. 477 * 478 * @interface ApnInfo 479 * @syscap SystemCapability.Telephony.CellularData 480 * @since 16 481 */ 482 interface ApnInfo { 483 /** 484 * Indicates APN name. 485 * 486 * @type { string } 487 * @syscap SystemCapability.Telephony.CellularData 488 * @since 16 489 */ 490 apnName: string; 491 /** 492 * Indicates APN. 493 * 494 * @type { string } 495 * @syscap SystemCapability.Telephony.CellularData 496 * @since 16 497 */ 498 apn: string; 499 /** 500 * Indicates APN mcc. 501 * 502 * @type { string } 503 * @syscap SystemCapability.Telephony.CellularData 504 * @since 16 505 */ 506 mcc: string; 507 /** 508 * Indicates APN mcc. 509 * 510 * @type { string } 511 * @syscap SystemCapability.Telephony.CellularData 512 * @since 16 513 */ 514 mnc: string; 515 /** 516 * Indicates APN user. 517 * 518 * @type { ?string } 519 * @syscap SystemCapability.Telephony.CellularData 520 * @since 16 521 */ 522 user?: string; 523 /** 524 * Indicates APN type. 525 * 526 * @type { ?string } 527 * @syscap SystemCapability.Telephony.CellularData 528 * @since 16 529 */ 530 type?: string; 531 /** 532 * Indicates APN proxy. 533 * 534 * @type { ?string } 535 * @syscap SystemCapability.Telephony.CellularData 536 * @since 16 537 */ 538 proxy?: string; 539 /** 540 * Indicates APN mmsproxy. 541 * 542 * @type { ?string } 543 * @syscap SystemCapability.Telephony.CellularData 544 * @since 16 545 */ 546 mmsproxy?: string; 547 } 548 549 /** 550 * Describes the cellular data flow type. 551 * 552 * @enum { number } 553 * @syscap SystemCapability.Telephony.CellularData 554 * @since 7 555 */ 556 export enum DataFlowType { 557 /** 558 * Indicates that there is no uplink or downlink data. 559 * 560 * @syscap SystemCapability.Telephony.CellularData 561 * @since 7 562 */ 563 DATA_FLOW_TYPE_NONE = 0, 564 565 /** 566 * Indicates that there is only downlink data. 567 * 568 * @syscap SystemCapability.Telephony.CellularData 569 * @since 7 570 */ 571 DATA_FLOW_TYPE_DOWN = 1, 572 573 /** 574 * Indicates that there is only uplink data. 575 * 576 * @syscap SystemCapability.Telephony.CellularData 577 * @since 7 578 */ 579 DATA_FLOW_TYPE_UP = 2, 580 581 /** 582 * Indicates that there is uplink and downlink data. 583 * 584 * @syscap SystemCapability.Telephony.CellularData 585 * @since 7 586 */ 587 DATA_FLOW_TYPE_UP_DOWN = 3, 588 589 /** 590 * Indicates that there is no uplink or downlink data, and the bottom-layer link is in the dormant state. 591 * 592 * @syscap SystemCapability.Telephony.CellularData 593 * @since 7 594 */ 595 DATA_FLOW_TYPE_DORMANT = 4 596 } 597 598 /** 599 * Describes the cellular data link connection state. 600 * 601 * @enum { number } 602 * @syscap SystemCapability.Telephony.CellularData 603 * @since 7 604 */ 605 export enum DataConnectState { 606 /** 607 * Indicates that a cellular data link is unknown. 608 * 609 * @syscap SystemCapability.Telephony.CellularData 610 * @since 7 611 */ 612 DATA_STATE_UNKNOWN = -1, 613 614 /** 615 * Indicates that a cellular data link is disconnected. 616 * 617 * @syscap SystemCapability.Telephony.CellularData 618 * @since 7 619 */ 620 DATA_STATE_DISCONNECTED = 0, 621 622 /** 623 * Indicates that a cellular data link is being connected. 624 * 625 * @syscap SystemCapability.Telephony.CellularData 626 * @since 7 627 */ 628 DATA_STATE_CONNECTING = 1, 629 630 /** 631 * Indicates that a cellular data link is connected. 632 * 633 * @syscap SystemCapability.Telephony.CellularData 634 * @since 7 635 */ 636 DATA_STATE_CONNECTED = 2, 637 638 /** 639 * Indicates that a cellular data link is suspended. 640 * 641 * @syscap SystemCapability.Telephony.CellularData 642 * @since 7 643 */ 644 DATA_STATE_SUSPENDED = 3 645 } 646} 647 648export default data; 649