From 3e43eaa8cabf471b98d70cf18188377fabc5f125 Mon Sep 17 00:00:00 2001 From: leo9001 Date: Wed, 13 Aug 2025 14:07:45 +0800 Subject: [PATCH] [issue]telephony_cellular_data ani [issue]telephony_cellular_data ani Issue: https://gitee.com/openharmony/telephony_cellular_data/issues/ICQCMW Signed-off-by: leo9001 --- api/@ohos.telephony.data.d.ts | 140 ++++++++++++++++++++-------------- 1 file changed, 84 insertions(+), 56 deletions(-) diff --git a/api/@ohos.telephony.data.d.ts b/api/@ohos.telephony.data.d.ts index dfb0635eba..ed8d1725b2 100644 --- a/api/@ohos.telephony.data.d.ts +++ b/api/@ohos.telephony.data.d.ts @@ -32,20 +32,22 @@ declare namespace data { /** * Get the default cellular data card. * - * @param { AsyncCallback } callback - Indicates the default cellular data slot id. + * @param { AsyncCallback } callback - Indicates the default cellular data slot id. * @syscap SystemCapability.Telephony.CellularData - * @since 7 + * @since arkts {'1.1':'7','1.2':'20'} + * @arkts 1.1&1.2 */ - function getDefaultCellularDataSlotId(callback: AsyncCallback): void; + function getDefaultCellularDataSlotId(callback: AsyncCallback): void; /** * Get the default cellular data card. * - * @returns { Promise } Returns the default cellular data slot id. + * @returns { Promise } Returns the default cellular data slot id. * @syscap SystemCapability.Telephony.CellularData - * @since 7 + * @since arkts {'1.1':'7','1.2':'20'} + * @arkts 1.1&1.2 */ - function getDefaultCellularDataSlotId(): Promise; + function getDefaultCellularDataSlotId(): Promise; /** * Get the default cellular data card. @@ -61,7 +63,7 @@ declare namespace data { * Switch cellular data services to another card, without changing the default settings. * * @permission ohos.permission.SET_TELEPHONY_STATE - * @param { number } slotId - Indicates the ID of the target card slot. + * @param { int } slotId - Indicates the ID of the target card slot. * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. * @param { AsyncCallback } callback - The callback of setDefaultCellularDataSlotId. * @throws { BusinessError } 201 - Permission denied. @@ -76,15 +78,16 @@ declare namespace data { * @throws { BusinessError } 8301001 - SIM card is not activated. * @syscap SystemCapability.Telephony.CellularData * @systemapi Hide this for inner system use. - * @since 7 + * @since arkts {'1.1':'7','1.2':'20'} + * @arkts 1.1&1.2 */ - function setDefaultCellularDataSlotId(slotId: number, callback: AsyncCallback): void; + function setDefaultCellularDataSlotId(slotId: int, callback: AsyncCallback): void; /** * Switch cellular data services to another card, without changing the default settings. * * @permission ohos.permission.SET_TELEPHONY_STATE - * @param { number } slotId - Indicates the ID of the target card slot. + * @param { int } slotId - Indicates the ID of the target card slot. * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. * @returns { Promise } The promise returned by the setDefaultCellularDataSlotId. * @throws { BusinessError } 201 - Permission denied. @@ -99,9 +102,10 @@ declare namespace data { * @throws { BusinessError } 8301001 - SIM card is not activated. * @syscap SystemCapability.Telephony.CellularData * @systemapi Hide this for inner system use. - * @since 7 + * @since arkts {'1.1':'7','1.2':'20'} + * @arkts 1.1&1.2 */ - function setDefaultCellularDataSlotId(slotId: number): Promise; + function setDefaultCellularDataSlotId(slotId: int): Promise; /** * Indicates that there is no uplink or downlink data. @@ -109,7 +113,8 @@ declare namespace data { *

It is a return value of service state query of cellular data services. * @param { AsyncCallback } callback - Indicates the data flow type. * @syscap SystemCapability.Telephony.CellularData - * @since 7 + * @since arkts {'1.1':'7','1.2':'20'} + * @arkts 1.1&1.2 */ function getCellularDataFlowType(callback: AsyncCallback): void; @@ -119,7 +124,8 @@ declare namespace data { *

It is a return value of service state query of cellular data services. * @returns { Promise } Returns the data flow type. * @syscap SystemCapability.Telephony.CellularData - * @since 7 + * @since arkts {'1.1':'7','1.2':'20'} + * @arkts 1.1&1.2 */ function getCellularDataFlowType(): Promise; @@ -204,7 +210,8 @@ declare namespace data { * @throws { BusinessError } 8300003 - System internal error. * @throws { BusinessError } 8300999 - Internal error. * @syscap SystemCapability.Telephony.CellularData - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ function isCellularDataEnabledSync(): boolean; @@ -286,7 +293,7 @@ declare namespace data { * Check whether roaming is enabled for cellular data services. * * @permission ohos.permission.GET_NETWORK_INFO - * @param { number } slotId - Indicates the ID of a card slot. + * @param { int } slotId - Indicates the ID of a card slot. * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. * @param { AsyncCallback } callback - Indicates the callback for checking whether roaming is enabled * for cellular data services. Returns {@code true} if roaming is enabled for cellular data services; @@ -299,15 +306,16 @@ declare namespace data { * @throws { BusinessError } 8300003 - System internal error. * @throws { BusinessError } 8300999 - Internal error. * @syscap SystemCapability.Telephony.CellularData - * @since 7 + * @since arkts {'1.1':'7','1.2':'20'} + * @arkts 1.1&1.2 */ - function isCellularDataRoamingEnabled(slotId: number, callback: AsyncCallback): void; + function isCellularDataRoamingEnabled(slotId: int, callback: AsyncCallback): void; /** * Check whether roaming is enabled for cellular data services. * * @permission ohos.permission.GET_NETWORK_INFO - * @param { number } slotId - Indicates the ID of a card slot. + * @param { int } slotId - Indicates the ID of a card slot. * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. * @returns { Promise } Returns {@code true} if roaming is enabled for cellular data services. * Returns {@code false} otherwise. @@ -319,15 +327,16 @@ declare namespace data { * @throws { BusinessError } 8300003 - System internal error. * @throws { BusinessError } 8300999 - Internal error. * @syscap SystemCapability.Telephony.CellularData - * @since 7 + * @since arkts {'1.1':'7','1.2':'20'} + * @arkts 1.1&1.2 */ - function isCellularDataRoamingEnabled(slotId: number): Promise; + function isCellularDataRoamingEnabled(slotId: int): Promise; /** * Check whether roaming is enabled for cellular data services. * * @permission ohos.permission.GET_NETWORK_INFO - * @param { number } slotId - Indicates the ID of a card slot. + * @param { int } slotId - Indicates the ID of a card slot. * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. * @returns { boolean } Returns {@code true} if roaming is enabled for cellular data services. * Returns {@code false} otherwise. @@ -339,15 +348,16 @@ declare namespace data { * @throws { BusinessError } 8300003 - System internal error. * @throws { BusinessError } 8300999 - Internal error. * @syscap SystemCapability.Telephony.CellularData - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ - function isCellularDataRoamingEnabledSync(slotId: number): boolean; + function isCellularDataRoamingEnabledSync(slotId: int): boolean; /** * Enable cellular data roaming. * * @permission ohos.permission.SET_TELEPHONY_STATE - * @param { number } slotId - Indicates the ID of a card slot. + * @param { int } slotId - Indicates the ID of a card slot. * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. * @param { AsyncCallback } callback - The callback of enableCellularDataRoaming. * @throws { BusinessError } 201 - Permission denied. @@ -360,15 +370,16 @@ declare namespace data { * @throws { BusinessError } 8300999 - Internal error. * @syscap SystemCapability.Telephony.CellularData * @systemapi Hide this for inner system use. - * @since 7 + * @since arkts {'1.1':'7','1.2':'20'} + * @arkts 1.1&1.2 */ - function enableCellularDataRoaming(slotId: number, callback: AsyncCallback): void; + function enableCellularDataRoaming(slotId: int, callback: AsyncCallback): void; /** * Enable cellular data roaming. * * @permission ohos.permission.SET_TELEPHONY_STATE - * @param { number } slotId - Indicates the ID of a card slot. + * @param { int } slotId - Indicates the ID of a card slot. * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. * @returns { Promise } The promise returned by the enableCellularDataRoaming. * @throws { BusinessError } 201 - Permission denied. @@ -381,15 +392,16 @@ declare namespace data { * @throws { BusinessError } 8300999 - Internal error. * @syscap SystemCapability.Telephony.CellularData * @systemapi Hide this for inner system use. - * @since 7 + * @since arkts {'1.1':'7','1.2':'20'} + * @arkts 1.1&1.2 */ - function enableCellularDataRoaming(slotId: number): Promise; + function enableCellularDataRoaming(slotId: int): Promise; /** * Disable cellular data roaming. * * @permission ohos.permission.SET_TELEPHONY_STATE - * @param { number } slotId - Indicates the ID of a card slot. + * @param { int } slotId - Indicates the ID of a card slot. * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. * @param { AsyncCallback } callback - The callback of disableCellularDataRoaming. * @throws { BusinessError } 201 - Permission denied. @@ -402,15 +414,16 @@ declare namespace data { * @throws { BusinessError } 8300999 - Internal error. * @syscap SystemCapability.Telephony.CellularData * @systemapi Hide this for inner system use. - * @since 7 + * @since arkts {'1.1':'7','1.2':'20'} + * @arkts 1.1&1.2 */ - function disableCellularDataRoaming(slotId: number, callback: AsyncCallback): void; + function disableCellularDataRoaming(slotId: int, callback: AsyncCallback): void; /** * Disable cellular data roaming. * * @permission ohos.permission.SET_TELEPHONY_STATE - * @param { number } slotId - Indicates the ID of a card slot. + * @param { int } slotId - Indicates the ID of a card slot. * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. * @returns { Promise } The promise returned by the disableCellularDataRoaming. * @throws { BusinessError } 201 - Permission denied. @@ -423,18 +436,20 @@ declare namespace data { * @throws { BusinessError } 8300999 - Internal error. * @syscap SystemCapability.Telephony.CellularData * @systemapi Hide this for inner system use. - * @since 7 + * @since arkts {'1.1':'7','1.2':'20'} + * @arkts 1.1&1.2 */ - function disableCellularDataRoaming(slotId: number): Promise; + function disableCellularDataRoaming(slotId: int): Promise; /** * Obtains the default cellular data SIM ID. * - * @returns { number } Returns the SIM ID of the default cellular data sim and SIM ID will increase from 1. + * @returns { int } Returns the SIM ID of the default cellular data sim and SIM ID will increase from 1. * @syscap SystemCapability.Telephony.CellularData - * @since 10 + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 */ - function getDefaultCellularDataSimId(): number; + function getDefaultCellularDataSimId(): int; /** * Query all APN info. @@ -443,7 +458,8 @@ declare namespace data { * @returns { Promise> } Returns all APN info of default cellular data card. * @throws { BusinessError } 201 - Permission denied. * @syscap SystemCapability.Telephony.CellularData - * @since 16 + * @since arkts {'1.1':'16','1.2':'20'} + * @arkts 1.1&1.2 */ function queryAllApns(): Promise>; @@ -454,7 +470,8 @@ declare namespace data { * @returns { Promise } Returns the name of the active APN or null if cellular network is not active. * @throws { BusinessError } 201 - Permission denied. * @syscap SystemCapability.Telephony.CellularData - * @since 20 + * @since arkts {'1.1':'20','1.2':'20'} + * @arkts 1.1&1.2 */ function getActiveApnName(): Promise; @@ -463,31 +480,34 @@ declare namespace data { * * @permission ohos.permission.MANAGE_APN_SETTING * @param { ApnInfo } apnInfo - The APN information that needs to be queried. - * @returns { Promise> } Returns IDs of all APNs that meet the query conditions. + * @returns { Promise> } Returns IDs of all APNs that meet the query conditions. * @throws { BusinessError } 201 - Permission denied. * @syscap SystemCapability.Telephony.CellularData - * @since 16 + * @since arkts {'1.1':'16','1.2':'20'} + * @arkts 1.1&1.2 */ - function queryApnIds(apnInfo: ApnInfo): Promise>; + function queryApnIds(apnInfo: ApnInfo): Promise>; /** * Set preferred APN. * * @permission ohos.permission.MANAGE_APN_SETTING - * @param { number } apnId - The APN ID which is used to be set. + * @param { int } apnId - The APN ID which is used to be set. * @returns { Promise } Returns {@code true} if preferred APN set success; returns {@code false} otherwise. * @throws { BusinessError } 201 - Permission denied. * @syscap SystemCapability.Telephony.CellularData - * @since 16 + * @since arkts {'1.1':'16','1.2':'20'} + * @arkts 1.1&1.2 */ - function setPreferredApn(apnId: number): Promise; + function setPreferredApn(apnId: int): Promise; /** * Defines the APN info. * * @interface ApnInfo * @syscap SystemCapability.Telephony.CellularData - * @since 16 + * @since arkts {'1.1':'16','1.2':'20'} + * @arkts 1.1&1.2 */ interface ApnInfo { /** @@ -495,7 +515,8 @@ declare namespace data { * * @type { string } * @syscap SystemCapability.Telephony.CellularData - * @since 16 + * @since arkts {'1.1':'16','1.2':'20'} + * @arkts 1.1&1.2 */ apnName: string; /** @@ -503,7 +524,8 @@ declare namespace data { * * @type { string } * @syscap SystemCapability.Telephony.CellularData - * @since 16 + * @since arkts {'1.1':'16','1.2':'20'} + * @arkts 1.1&1.2 */ apn: string; /** @@ -511,7 +533,8 @@ declare namespace data { * * @type { string } * @syscap SystemCapability.Telephony.CellularData - * @since 16 + * @since arkts {'1.1':'16','1.2':'20'} + * @arkts 1.1&1.2 */ mcc: string; /** @@ -519,7 +542,8 @@ declare namespace data { * * @type { string } * @syscap SystemCapability.Telephony.CellularData - * @since 16 + * @since arkts {'1.1':'16','1.2':'20'} + * @arkts 1.1&1.2 */ mnc: string; /** @@ -527,7 +551,8 @@ declare namespace data { * * @type { ?string } * @syscap SystemCapability.Telephony.CellularData - * @since 16 + * @since arkts {'1.1':'16','1.2':'20'} + * @arkts 1.1&1.2 */ user?: string; /** @@ -535,7 +560,8 @@ declare namespace data { * * @type { ?string } * @syscap SystemCapability.Telephony.CellularData - * @since 16 + * @since arkts {'1.1':'16','1.2':'20'} + * @arkts 1.1&1.2 */ type?: string; /** @@ -543,7 +569,8 @@ declare namespace data { * * @type { ?string } * @syscap SystemCapability.Telephony.CellularData - * @since 16 + * @since arkts {'1.1':'16','1.2':'20'} + * @arkts 1.1&1.2 */ proxy?: string; /** @@ -551,7 +578,8 @@ declare namespace data { * * @type { ?string } * @syscap SystemCapability.Telephony.CellularData - * @since 16 + * @since arkts {'1.1':'16','1.2':'20'} + * @arkts 1.1&1.2 */ mmsproxy?: string; } -- Gitee