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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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