diff --git a/api/@ohos.contact.d.ts b/api/@ohos.contact.d.ts index 8242ea2aa908223940061fe16f7ff3421e38f5e7..17d1ce7ad0c40fbb4d88207d1f132705bbd52ad4 100644 --- a/api/@ohos.contact.d.ts +++ b/api/@ohos.contact.d.ts @@ -26,22 +26,31 @@ declare namespace contact { /** * Creates a contact. * - *

Permissions required: {@code ohos.permission.READ_CONTACTS} and {@code ohos.permission.WRITE_CONTACTS} - * * @param contact Indicates the contact information. * @return Returns the contact ID (which can be obtained by {@link Contact#getId()}) if the creation is successful; * returns {@link Contact#INVALID_CONTACT_ID} if the creation fails. + * @permision ohos.permission.WRITE_CONTACTS */ function addContact(contact: Contact, callback: AsyncCallback): void; function addContact(contact: Contact): Promise; /** - * Deletes a specified contact. + * Select contact. * - *

Permissions required: {@code ohos.permission.READ_CONTACTS} and {@code ohos.permission.WRITE_CONTACTS} + * @return Returns the contact list which user select; + * returns empty contact list if user not select. + * @syscap SystemCapability.Applications.ContactsData, SystemCapability.Applications.Contacts + * @permission ohos.permission.READ_CONTACTS + */ + function selectContact(callback: AsyncCallback>): void; + function selectContact(): Promise>; + + /** + * Deletes a specified contact. * * @param key Indicates the unique query key of a contact to delete. * @return Returns {@code true} if the contact is deleted; returns {@code false} otherwise. + * @permision ohos.permission.WRITE_CONTACTS */ function deleteContact(key: string, callback: AsyncCallback): void; function deleteContact(key: string): Promise; @@ -49,12 +58,11 @@ declare namespace contact { /** * Queries a specified contact of specified attributes. * - *

Permissions required: {@code ohos.permission.READ_CONTACTS} and {@code ohos.permission.WRITE_CONTACTS} - * * @param key Indicates the unique query key of a contact. * @param holder Indicates the contact holder. If this parameter is null, the default holder is used for matching. * @param attrs Indicates the contact attributes. If this parameter is null, all attributes are used for matching. * @return Returns the specified contact. + * @permission ohos.permission.READ_CONTACTS */ function queryContact(key: string, callback: AsyncCallback): void; function queryContact(key: string, holder: Holder, callback: AsyncCallback): void; @@ -65,11 +73,10 @@ declare namespace contact { /** * Queries contacts with query conditions. * - *

Permissions required: {@code ohos.permission.READ_CONTACTS} and {@code ohos.permission.WRITE_CONTACTS} - * * @param holder Indicates the contact holder. If this parameter is null, the default holder is used for matching. * @param attrs Indicates the contact attributes. If this parameter is null, all attributes are used for matching. * @return Returns the {@code Contact} list object. + * @permission ohos.permission.READ_CONTACTS */ function queryContacts(callback: AsyncCallback>): void; function queryContacts(holder: Holder, callback: AsyncCallback>): void; @@ -80,12 +87,11 @@ declare namespace contact { /** * Queries contacts by a specified email address, contact holder, and contact attributes. * - *

Permissions required: {@code ohos.permission.READ_CONTACTS} and {@code ohos.permission.WRITE_CONTACTS} - * * @param email Indicates the email address. * @param holder Indicates the contact holder. If this parameter is null, the default holder is used for matching. * @param attrs Indicates the contact attributes. If this parameter is null, all attributes are used for matching. * @return Returns a {@code Contact} list object. + * @permission ohos.permission.READ_CONTACTS */ function queryContactsByEmail(email: string, callback: AsyncCallback>): void; function queryContactsByEmail(email: string, holder: Holder, callback: AsyncCallback>): void; @@ -96,13 +102,12 @@ declare namespace contact { /** * Queries contacts by a phone number, holder, and contact attribute. * - *

Permissions required: {@code ohos.permission.READ_CONTACTS} and {@code ohos.permission.WRITE_CONTACTS}. - * * @param phoneNumber Indicates the phone number. Only full match is supported, and wildcards are not supported. * @param holder Indicates the contact holder. If this parameter is null, the default holder is used for matching. * @param attrs Indicates the contact attribute. If this parameter is null, * all attributes will be used for matching. * @return Returns the {@code Contact} list object. + * @permission ohos.permission.READ_CONTACTS */ function queryContactsByPhoneNumber(phoneNumber: string, callback: AsyncCallback>): void; function queryContactsByPhoneNumber(phoneNumber: string, holder: Holder, callback: AsyncCallback>): void; @@ -113,10 +118,9 @@ declare namespace contact { /** * Queries contact groups. * - *

Permissions required: {@code ohos.permission.READ_CONTACTS} and {@code ohos.permission.WRITE_CONTACTS} - * * @param holder Indicates the contact holder. If this parameter is null, the default holder is used for matching. * @return Returns the contact group list. + * @permission ohos.permission.READ_CONTACTS */ function queryGroups(callback: AsyncCallback>): void; function queryGroups(holder: Holder, callback: AsyncCallback>): void; @@ -125,9 +129,8 @@ declare namespace contact { /** * Queries contact holders. * - *

Permissions required: {@code ohos.permission.READ_CONTACTS} and {@code ohos.permission.WRITE_CONTACTS} - * * @return Returns the {@code Holder} list object. + * @permission ohos.permission.READ_CONTACTS */ function queryHolders(callback: AsyncCallback>): void; function queryHolders(): Promise>; @@ -135,11 +138,10 @@ declare namespace contact { /** * Obtains the query key of a contact based on a specified ID and holder. * - *

Permissions required: {@code ohos.permission.READ_CONTACTS} and {@code ohos.permission.WRITE_CONTACTS} - * * @param id Indicates the contact ID. * @param holder Indicates the contact holder. If this parameter is null, the default holder is used for matching. * @return Returns the query key of the contact. + * @permission ohos.permission.READ_CONTACTS */ function queryKey(id: number, callback: AsyncCallback): void; function queryKey(id: number, holder: Holder, callback: AsyncCallback): void; @@ -148,10 +150,9 @@ declare namespace contact { /** * Queries information about "my card". * - *

Permissions required: {@code ohos.permission.READ_CONTACTS} and {@code ohos.permission.WRITE_CONTACTS} - * * @param attrs Indicates the contact attributes. If this parameter is null, all attributes are used for matching. * @return Returns information about "my card". + * @permission ohos.permission.READ_CONTACTS */ function queryMyCard(callback: AsyncCallback): void; function queryMyCard(attrs: ContactAttributes, callback: AsyncCallback): void; @@ -160,12 +161,11 @@ declare namespace contact { /** * Updates specified attributes of a contact. * - *

Permissions required: {@code ohos.permission.READ_CONTACTS} and {@code ohos.permission.WRITE_CONTACTS} - * * @param contact Indicates the contact whose information is to update. * @param attrs Indicates the contact attributes to update. If this parameter is null, * all available attributes will be updated. * @return Returns {@code true} if the update is successful; returns {@code false} otherwise. + * @permision ohos.permission.WRITE_CONTACTS */ function updateContact(contact: Contact, callback: AsyncCallback): void; function updateContact(contact: Contact, attrs: ContactAttributes, callback: AsyncCallback): void; @@ -174,10 +174,9 @@ declare namespace contact { /** * Checks whether the contact ID is in the local phone book. * - *

Permissions required: {@code ohos.permission.READ_CONTACTS} and {@code ohos.permission.WRITE_CONTACTS} - * * @param id Indicates the contact ID. * @return Returns {@code true} if the contact ID is in the local phone book; returns {@code false} otherwise. + * @permission ohos.permission.READ_CONTACTS */ function isLocalContact(id: number, callback: AsyncCallback): void; function isLocalContact(id: number): Promise; @@ -187,6 +186,7 @@ declare namespace contact { * * @param id Indicates the contact ID. * @return Returns {@code true} if the contact ID is of "my card"; returns {@code false} otherwise. + * @permission ohos.permission.READ_CONTACTS */ function isMyCard(id: number, callback: AsyncCallback): void; function isMyCard(id: number): Promise; diff --git a/api/@ohos.net.connection.d.ts b/api/@ohos.net.connection.d.ts index 3ff974a7558c559153b9f2c6c1ff02df4843297e..ad31470548326a71072f5f033a80691786475118 100644 --- a/api/@ohos.net.connection.d.ts +++ b/api/@ohos.net.connection.d.ts @@ -40,8 +40,6 @@ declare namespace connection { /** * Obtains the data network that is activated by default. * - *

To call this method, you must have the {@code ohos.permission.GET_NETWORK_INFO} permission. - * * @param callback Returns the {@link NetHandle} object; * returns {@code null} if the default network is not activated. * @permission ohos.permission.GET_NETWORK_INFO @@ -52,8 +50,6 @@ declare namespace connection { /** * Obtains the list of data networks that are activated. * - *

To invoke this method, you must have the {@code ohos.permission.GET_NETWORK_INFO} permission. - * * @param callback Returns the {@link NetHandle} object; returns {@code null} if no network is activated. * @permission ohos.permission.GET_NETWORK_INFO */ @@ -63,8 +59,6 @@ declare namespace connection { /** * Queries the connection properties of a network. * - *

This method requires the {@code ohos.permission.GET_NETWORK_INFO} permission. - * * @param netHandle Indicates the network to be queried. * @param callback Returns the {@link ConnectionProperties} object. * @permission ohos.permission.GET_NETWORK_INFO @@ -75,8 +69,6 @@ declare namespace connection { /** * Obtains {@link NetCapabilities} of a {@link NetHandle} object. * - *

To invoke this method, you must have the {@code ohos.permission.GET_NETWORK_INFO} permission. - * * @param netHandle Indicates the handle. See {@link NetHandle}. * @param callback Returns {@link NetCapabilities}; returns {@code null} if {@code handle} is invalid. * @permission ohos.permission.GET_NETWORK_INFO @@ -170,21 +162,12 @@ declare namespace connection { export interface NetHandle { netId: number; - /** - * Binds a TCPSocket or UDPSocket to the current network. All data flows from - * the socket will use this network, without being subject to {@link setAppNet}. - * Before using this method, ensure that the socket is disconnected. - * - * @param socketParam Indicates the TCPSocket or UDPSocket object. - */ - bindSocket(socketParam: TCPSocket | UDPSocket, callback: AsyncCallback): void; - bindSocket(socketParam: TCPSocket | UDPSocket): Promise; - /** * Resolves a host name to obtain all IP addresses based on the specified NetHandle. * * @param host Indicates the host name or the domain. * @param callback Returns the NetAddress list. + * @permission ohos.permission.GET_NETWORK_INFO */ getAddressesByName(host: string, callback: AsyncCallback>): void; getAddressesByName(host: string): Promise>; @@ -194,6 +177,7 @@ declare namespace connection { * * @param host Indicates the host name or the domain. * @return Returns the first NetAddress. + * @permission ohos.permission.GET_NETWORK_INFO */ getAddressByName(host: string, callback: AsyncCallback): void; getAddressByName(host: string): Promise; @@ -272,9 +256,6 @@ declare namespace connection { prefixLength: number; } - /** - * @since 7 - */ export interface NetAddress { address: string; family?: number; // IPv4 = 1; IPv6 = 2, default is IPv4 diff --git a/api/@ohos.telephony.call.d.ts b/api/@ohos.telephony.call.d.ts index 96816be1f73218cc187011b08e712b40e868e691..ea018eefd1f7c8cf596c419a53266c809ad5f8c9 100644 --- a/api/@ohos.telephony.call.d.ts +++ b/api/@ohos.telephony.call.d.ts @@ -25,8 +25,6 @@ declare namespace call { /** * Makes a call. * - *

Applications must have the {@code ohos.permission.PLACE_CALL} permission to call this method. - * * @param phoneNumber Indicates the called number. * @param options Indicates additional information carried in the call. * @param callback Returns {@code true} if the call request is successful; returns {@code false} otherwise. @@ -75,7 +73,7 @@ declare namespace call { * *

If an incoming call is ringing, the phone stops ringing. Otherwise, this method does not function. * - * @permission ohos.permission.SET_TELEPHONY_STATE or System App + * @permission ohos.permission.SET_TELEPHONY_STATE * @systemapi Hide this for inner system use. * @since 8 */ @@ -134,6 +132,7 @@ declare namespace call { /** * @systemapi Hide this for inner system use. + * @permission ohos.permission.ANSWER_CALL * @since 7 */ function answer(callId: number, callback: AsyncCallback): void; diff --git a/api/@ohos.telephony.data.d.ts b/api/@ohos.telephony.data.d.ts index d32d033a35fb9102b344307e8198246ffc9974a2..a82b90e3dd203f02940c831c92af55e69c970de6 100644 --- a/api/@ohos.telephony.data.d.ts +++ b/api/@ohos.telephony.data.d.ts @@ -25,8 +25,6 @@ declare namespace data { /** * Checks whether cellular data services are enabled. * - *

Requires Permission: {@code ohos.permission.GET_NETWORK_INFO}. - * * @return Returns {@code true} if cellular data services are enabled; returns {@code false} otherwise. * @permission ohos.permission.GET_NETWORK_INFO */ @@ -72,9 +70,8 @@ declare namespace data { /** * Checks whether cellular data services are enabled. * - *

Requires Permission: {@code ohos.permission.GET_NETWORK_INFO}. - * * @param callback Returns {@code true} if cellular data services are enabled; returns {@code false} otherwise. + * @permission ohos.permission.GET_NETWORK_INFO */ function isCellularDataEnabled(callback: AsyncCallback): void; function isCellularDataEnabled(): Promise; @@ -100,8 +97,6 @@ declare namespace data { /** * Checks whether roaming is enabled for cellular data services. * - *

Requires Permission: {@code ohos.permission.GET_NETWORK_INFO}. - * * @param slotId Indicates the ID of a card slot. * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. * @param callback Returns {@code true} if roaming is enabled for cellular data services; returns {@code false} otherwise. diff --git a/api/@ohos.telephony.observer.d.ts b/api/@ohos.telephony.observer.d.ts index 8193aca0556d6a93da396099949fda566c6e06a1..5ea7c6a3250c18ec1f8c0b4340252e424a1e087c 100644 --- a/api/@ohos.telephony.observer.d.ts +++ b/api/@ohos.telephony.observer.d.ts @@ -40,9 +40,6 @@ declare namespace observer { /** * Called when the network state corresponding to a monitored {@code slotId} updates. * - *

Applications must have the {@code ohos.permission.GET_NETWORK_INFO} permission - * to register this event. - * * @param type networkStateChange * @param options including slotId Indicates the ID of the target card slot. * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. @@ -71,9 +68,6 @@ declare namespace observer { /** * Called back when the cell information corresponding to a monitored {@code slotId} updates. * - *

Applications must have the {@code ohos.permission.LOCATION} permission - * to register this event. - * * @param type cellInfoChange * @param options including slotId Indicates the ID of the target card slot. * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. @@ -107,6 +101,9 @@ declare namespace observer { function on(type: 'cellularDataConnectionStateChange', options: { slotId: number }, callback: Callback<{ state: DataConnectState, network: RatType }>): void; + /** + * @since 7 + */ function off(type: 'cellularDataConnectionStateChange', callback?: Callback<{ state: DataConnectState, network: RatType }>): void; @@ -123,6 +120,9 @@ declare namespace observer { function on(type: 'cellularDataFlowChange', options: { slotId: number }, callback: Callback): void; + /** + * @since 7 + */ function off(type: 'cellularDataFlowChange', callback?: Callback): void; /** @@ -134,7 +134,7 @@ declare namespace observer { * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. * @param callback including state Indicates the call state, and number Indicates the called number. * The value of number is an empty string if the application does not have - * the {@code ohos.permission#READ_CALL_LOG READ_CALL_LOG} permission. + * the ohos.permission.READ_CALL_LOG permission. */ function on(type: 'callStateChange', callback: Callback<{ state: CallState, number: string }>): void; function on(type: 'callStateChange', options: { slotId: number }, @@ -156,6 +156,9 @@ declare namespace observer { function on(type: 'simStateChange', callback: Callback): void; function on(type: 'simStateChange', options: { slotId: number }, callback: Callback): void; + /** + * @since 7 + */ function off(type: 'simStateChange', callback?: Callback): void; /** diff --git a/api/@ohos.telephony.radio.d.ts b/api/@ohos.telephony.radio.d.ts index c7486d60a3605c3ca85ed67a85e245f78494f02b..0975e3245b9eae7d943b97b1e216e6172098bba6 100644 --- a/api/@ohos.telephony.radio.d.ts +++ b/api/@ohos.telephony.radio.d.ts @@ -28,8 +28,6 @@ declare namespace radio { * Obtains radio access technology (RAT) of the registered network. The system * returns RAT of the packet service (PS) and circuit service (CS) domain. * - *

Requires Permission: {@code ohos.permission.GET_NETWORK_INFO}. - * * @param slotId Indicates the card slot index number, * ranging from 0 to the maximum card slot index number supported by the device. * @param callback Returns an integer indicating the RAT in use. The values are as follows: @@ -57,8 +55,6 @@ declare namespace radio { /** * Obtains the network state of the registered network. * - *

Requires Permission: {@code ohos.permission.GET_NETWORK_INFO}. - * * @param slotId Indicates the card slot index number, * ranging from 0 to the maximum card slot index number supported by the device. * @param callback Returns a {@code NetworkState} object. @@ -137,8 +133,6 @@ declare namespace radio { /** * Obtains the IMEI of a specified card slot of the device. * - *

Requires Permission: {@code ohos.permission.GET_TELEPHONY_STATE}. - * * @param slotId Indicates the card slot index number, ranging from 0 to the maximum card slot index number * supported by the device. * @param callback Returns the IMEI; returns an empty string if the IMEI does not exist. @@ -153,8 +147,6 @@ declare namespace radio { /** * Obtains the MEID of a specified card slot of the device. * - *

Requires Permission: {@code ohos.permission.GET_TELEPHONY_STATE}. - * * @param slotId Indicates the card slot index number, ranging from 0 to the maximum card slot index number * supported by the device. * @param callback Returns the MEID; returns an empty string if the MEID does not exist. @@ -173,8 +165,6 @@ declare namespace radio { * (IMEI) is returned. If the device is registered with a 3GPP2-compliant network, the mobile equipment identifier * (MEID) is returned. * - *

Requires Permission: {@code ohos.permission.GET_TELEPHONY_STATE}. - * * @param slotId Indicates the card slot index number, ranging from 0 to the maximum card slot index number * supported by the device. * @param callback Returns the unique device ID; returns an empty string if the unique device ID does not exist. diff --git a/api/@ohos.telephony.sim.d.ts b/api/@ohos.telephony.sim.d.ts index 3b3eac8443bfc48caf9dc75eee94365c89388fc3..1ff02a7ba88813d43772590c617a04998a75dafd 100644 --- a/api/@ohos.telephony.sim.d.ts +++ b/api/@ohos.telephony.sim.d.ts @@ -127,8 +127,6 @@ declare namespace sim { *

The ICCID is a unique identifier of a SIM card. It consists of 20 digits * and is recorded in the EFICCID file of the SIM card. * - *

Requires Permission: {@code ohos.permission.GET_TELEPHONY_STATE}. - * * @param slotId Indicates the card slot index number, * ranging from 0 to the maximum card slot index number supported by the device. * @param callback Returns the ICCID; returns an empty string if no SIM card is inserted. @@ -142,8 +140,6 @@ declare namespace sim { /** * Obtains the alpha identifier of the voice mailbox of the SIM card in a specified slot. * - *

Only applications with the {@code ohos.permission.GET_TELEPHONY_STATE} permission can call this method. - * * @param slotId Indicates the card slot index number, * ranging from {@code 0} to the maximum card slot index number supported by the device. * @param callback Returns the voice mailbox alpha identifier; @@ -158,8 +154,6 @@ declare namespace sim { /** * Obtains the voice mailbox number of the SIM card in a specified slot. * - *

Only applications with the {@code ohos.permission.GET_TELEPHONY_STATE} permission can call this method. - * * @param slotId Indicates the card slot index number, * ranging from {@code 0} to the maximum card slot index number supported by the device. * @param callback Returns the voice mailbox number; @@ -183,8 +177,6 @@ declare namespace sim { * Obtains the MSISDN of the SIM card in a specified slot. * The MSISDN is recorded in the EFMSISDN file of the SIM card. * - *

Requires Permission: {@code ohos.permission.GET_TELEPHONY_STATE}. - * * @param slotId Indicates the card slot index number, * ranging from 0 to the maximum card slot index number supported by the device. * @param callback Returns the MSISDN; returns an empty string if no SIM card is inserted or @@ -200,8 +192,6 @@ declare namespace sim { * Obtains the Group Identifier Level 1 (GID1) of the SIM card in a specified slot. * The GID1 is recorded in the EFGID1 file of the SIM card. * - *

Requires Permission: {@code ohos.permission.GET_TELEPHONY_STATE}. - * * @param slotId Indicates the card slot index number, * ranging from 0 to the maximum card slot index number supported by the device. * @param callback Returns the GID1; returns an empty string if no SIM card is inserted or diff --git a/api/@ohos.telephony.sms.d.ts b/api/@ohos.telephony.sms.d.ts index d67425155519d9338bd5cd242cfdf8cd38016359..42b9cf126368c27d4f6ef92ac55f071f02df169c 100644 --- a/api/@ohos.telephony.sms.d.ts +++ b/api/@ohos.telephony.sms.d.ts @@ -27,7 +27,6 @@ declare namespace sms { * *

If the length of an SMS message exceeds the maximum length allowed (140 bytes), * the SMS message is split into multiple segments for processing. - *

Applications must have the {@code ohos.permission.SEND_MESSAGES} permission to call this method. * * @param content Indicates the short message content, which cannot be {@code null}. * @param callback Returns a list of split segments, which can be combined into a complete SMS message; @@ -59,8 +58,6 @@ declare namespace sms { * *

This method checks whether the length of an SMS message exceeds the maximum length. If the * maximum length is exceeded, the SMS message is split into multiple parts and sent separately. - *

You need to obtain the following permission before calling this method: - * {@code ohos.permission.SEND_MESSAGES} * * @param options Indicates the parameters and callback for sending the SMS message. * @permission ohos.permission.SEND_MESSAGES @@ -93,8 +90,6 @@ declare namespace sms { /** * Sets the address for the Short Message Service Center (SMSC) based on a specified slot ID. * - *

Permissions: {@link ohos.security.SystemPermission#SET_TELEPHONY_STATE} - * * @param slotId Indicates the ID of the slot holding the SIM card for sending SMS messages. * @param smscAddr Indicates the SMSC address. * @permission ohos.permission.SET_TELEPHONY_STATE @@ -107,8 +102,6 @@ declare namespace sms { /** * Obtains the SMSC address based on a specified slot ID. * - *

Permissions: {@link ohos.security.SystemPermission#GET_TELEPHONY_STATE} - * * @param slotId Indicates the ID of the slot holding the SIM card for sending SMS messages. * @param callback Returns the SMSC address. * @permission ohos.permission.GET_TELEPHONY_STATE @@ -128,7 +121,7 @@ declare namespace sms { function hasSmsCapability(): boolean; /** - * @permission ohos.permission.RECEIVE_SMS,ohos.permission.SEND_MESSAGES + * @permission ohos.permission.RECEIVE_SMS and ohos.permission.SEND_MESSAGES * @systemapi Hide this for inner system use. * @since 7 */ @@ -136,7 +129,7 @@ declare namespace sms { function addSimMessage(options: SimMessageOptions): Promise; /** - * @permission ohos.permission.RECEIVE_SMS,ohos.permission.SEND_MESSAGES + * @permission ohos.permission.RECEIVE_SMS and ohos.permission.SEND_MESSAGES * @systemapi Hide this for inner system use. * @since 7 */ @@ -144,7 +137,7 @@ declare namespace sms { function delSimMessage(slotId: number, msgIndex: number): Promise; /** - * @permission ohos.permission.RECEIVE_SMS,ohos.permission.SEND_MESSAGES + * @permission ohos.permission.RECEIVE_SMS and ohos.permission.SEND_MESSAGES * @systemapi Hide this for inner system use. * @since 7 */