diff --git a/api/@ohos.accessibility.d.ts b/api/@ohos.accessibility.d.ts index b834ba05db6f92839c5d7bd559302b63988f8284..40faa01613bfa210110ca4338d4fa38168c9a222 100644 --- a/api/@ohos.accessibility.d.ts +++ b/api/@ohos.accessibility.d.ts @@ -15,27 +15,26 @@ import { AsyncCallback } from './basic'; import { Callback } from './basic'; -import { AbilityInfo } from './bundle/abilityInfo'; /** * Accessibility * @name Accessibility * @since 7 - * @syscap SystemCapability.Barrierfree.Accessibility.Core + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @import basic,abilityInfo */ declare namespace accessibility { /** * The type of the Ability app. - * @syscap SystemCapability.Barrierfree.Accessibility.Core + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ type AbilityType = 'audible' | 'generic' | 'haptic' | 'spoken' | 'visual'; /** * The action that the ability can execute. - * @syscap SystemCapability.Barrierfree.Accessibility.Core + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ type Action = 'accessibilityFocus' | 'clearAccessibilityFocus' | 'focus' | 'clearFocus' | 'clearSelection' | @@ -50,7 +49,7 @@ declare namespace accessibility { * @note announcement * @note notificationChange * @note textTraversedAtMove - * @syscap SystemCapability.Barrierfree.Accessibility.Core + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ type EventType = 'accessibilityFocus' | 'accessibilityFocusClear' | @@ -60,14 +59,14 @@ declare namespace accessibility { /** * The change type of the windowsChange event. * @note It's used when received the {@code windowsChange} event. - * @syscap SystemCapability.Barrierfree.Accessibility.Core + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ type WindowUpdateType = 'add' | 'remove' | 'bounds' | 'active' | 'focus'; /** * The type of the ability state. - * @syscap SystemCapability.Barrierfree.Accessibility.Core + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ type AbilityState = 'enable' | 'disable' | 'install'; @@ -80,7 +79,7 @@ declare namespace accessibility { * windowContent: Describes the capability to search for the content of the active window. * filterKeyEvents: Describes the capability to request to filter key events. * fingerprintGesture: Describes the capability to request to fingerprint gesture. - * @syscap SystemCapability.Barrierfree.Accessibility.Core + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ type Capability = 'retrieve' | 'touchGuide' | 'keyEventObserver' | 'zoom' | 'gesture'; @@ -88,7 +87,7 @@ declare namespace accessibility { /** * The granularity of text move. * @note The granularity of text move. - * @syscap SystemCapability.Barrierfree.Accessibility.Core + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ type TextMoveUnit = 'char' | 'word' | 'line' | 'page' | 'paragraph'; @@ -97,7 +96,7 @@ declare namespace accessibility { * Checks whether accessibility ability is enabled. * @since 7 * @param callback Asynchronous callback interface. - * @syscap SystemCapability.Barrierfree.Accessibility.Core + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @return Returns {@code true} if the accessibility is enabled; returns {@code false} otherwise. */ function isOpenAccessibility(callback: AsyncCallback): void; @@ -107,7 +106,7 @@ declare namespace accessibility { * Checks touch browser ability (which is used by talkback) is enabled. * @since 7 * @param callback Asynchronous callback interface. - * @syscap SystemCapability.Barrierfree.Accessibility.Vision + * @syscap SystemCapability.BarrierFree.Accessibility.Vision * @return Returns {@code true} if the touch browser is enabled; returns {@code false} otherwise. */ function isOpenTouchGuide(callback: AsyncCallback): void; @@ -118,7 +117,7 @@ declare namespace accessibility { * @since 7 * @param abilityType The type of the accessibility ability. {@code AbilityType} eg.spoken * @param stateType The state of the accessibility ability. {@code AbilityState} eg.installed - * @syscap SystemCapability.Barrierfree.Accessibility.Core + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @return Returns the list of abilityInfos. */ function getAbilityLists(abilityType: AbilityType, stateType: AbilityState, @@ -131,7 +130,7 @@ declare namespace accessibility { * @since 7 * @param event The object of the accessibility {@code EventInfo} . * @param callback Asynchronous callback interface. - * @syscap SystemCapability.Barrierfree.Accessibility.Core + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @return Returns {@code true} if success ; returns {@code false} otherwise. */ function sendEvent(event: EventInfo, callback: AsyncCallback): void; @@ -142,7 +141,7 @@ declare namespace accessibility { * @since 7 * @param type state event type. * @param callback Asynchronous callback interface. - * @syscap SystemCapability.Barrierfree.Accessibility.Core + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @return Returns {@code true} if the register is success ; returns {@code false} otherwise. */ function on(type: 'accessibilityStateChange', callback: Callback): void; @@ -152,7 +151,7 @@ declare namespace accessibility { * @since 7 * @param type state event type. * @param callback Asynchronous callback interface. - * @syscap SystemCapability.Barrierfree.Accessibility.Vision + * @syscap SystemCapability.BarrierFree.Accessibility.Vision * @return Returns {@code true} if the register is success ; returns {@code false} otherwise. */ function on(type: 'touchGuideStateChange', callback: Callback): void; @@ -162,7 +161,7 @@ declare namespace accessibility { * @since 7 * @param type state event type * @param callback Asynchronous callback interface. - * @syscap SystemCapability.Barrierfree.Accessibility.Core + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @return Returns {@code true} if the deregister is success ; returns {@code false} otherwise. */ function off(type: 'accessibilityStateChange', callback?: Callback): void; @@ -178,7 +177,7 @@ declare namespace accessibility { /** * Get the captions manager. - * @syscap SystemCapability.Barrierfree.Accessibility.Hearing + * @syscap SystemCapability.BarrierFree.Accessibility.Hearing * @since 8 * @return Returns the captions manager. */ @@ -186,7 +185,7 @@ declare namespace accessibility { /** * Indicates the captions manager. - * @syscap SystemCapability.Barrierfree.Accessibility.Hearing + * @syscap SystemCapability.BarrierFree.Accessibility.Hearing * @since 8 */ interface CaptionsManager { @@ -219,20 +218,20 @@ declare namespace accessibility { /** * Indicates the edge type of the captions font. - * @syscap SystemCapability.Barrierfree.Accessibility.Hearing + * @syscap SystemCapability.BarrierFree.Accessibility.Hearing * @since 8 */ type CaptionsFontEdgeType = 'none' | 'raised' | 'depressed' | 'uniform' | 'dropShadow'; /** * Indicates the font family of captions. - * @syscap SystemCapability.Barrierfree.Accessibility.Hearing + * @syscap SystemCapability.BarrierFree.Accessibility.Hearing * @since 8 */ type CaptionsFontFamily = 'default' | 'monospacedSerif' | 'serif' | 'monospacedSansSerif' | 'sansSerif' | 'casual' | 'cursive' | 'smallCapitals'; /** * Indicates the style of captions. - * @syscap SystemCapability.Barrierfree.Accessibility.Hearing + * @syscap SystemCapability.BarrierFree.Accessibility.Hearing * @since 8 */ interface CaptionsStyle { @@ -264,7 +263,7 @@ declare namespace accessibility { /** * Indicates the info of accessibility. - * @syscap SystemCapability.Barrierfree.Accessibility.Core + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ interface AccessibilityAbilityInfo { @@ -312,7 +311,7 @@ declare namespace accessibility { /** * Indicates the info of events. - * @syscap SystemCapability.Barrierfree.Accessibility.Core + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ class EventInfo { diff --git a/api/@ohos.account.distributedAccount.d.ts b/api/@ohos.account.distributedAccount.d.ts index 38a0fa43bd19d003d967e3f1c7759eefd2c32ec5..ae809f7f65391286b6b70347c0f596fe43235370 100644 --- a/api/@ohos.account.distributedAccount.d.ts +++ b/api/@ohos.account.distributedAccount.d.ts @@ -45,7 +45,7 @@ declare namespace distributedAccount { * * @since 7 * @return The distributed information of the current OS account. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.DISTRIBUTED_DATASYNC */ queryOsAccountDistributedInfo(callback: AsyncCallback): void; queryOsAccountDistributedInfo(): Promise; diff --git a/api/@ohos.account.osAccount.d.ts b/api/@ohos.account.osAccount.d.ts index 703c36b1f37f2cf19e6223ba85f07080dac6bfc9..20707b3af7b297c36ada4ee6bf0dae3c1f099f26 100644 --- a/api/@ohos.account.osAccount.d.ts +++ b/api/@ohos.account.osAccount.d.ts @@ -69,7 +69,7 @@ declare namespace osAccount { * @since 7 * @param localId Indicates the local ID of the OS account. * @return Returns {@code true} if the OS account is activated; returns {@code false} otherwise. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS/ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS */ isOsAccountActived(localId: number, callback: AsyncCallback): void; isOsAccountActived(localId: number): Promise; @@ -121,7 +121,7 @@ declare namespace osAccount { * @param localId Indicates the local ID of the OS account. * @return Returns {@code true} if the OS account has been verified successfully; * returns {@code false} otherwise. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS/ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. */ isOsAccountVerified(localId: number, callback: AsyncCallback): void; isOsAccountVerified(localId?: number): Promise; @@ -169,6 +169,7 @@ declare namespace osAccount { * @param localId Indicates the local ID of the OS account. * @param localName Indicates the local name to set for the OS account. * @return void. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS. * @systemapi Hide this for inner system use. */ setOsAccountName(localId: number, localName: string, callback: AsyncCallback): void; @@ -241,6 +242,7 @@ declare namespace osAccount { * @since 7 * @return Returns a list of OS accounts. * @systemapi Hide this for inner system use. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS. */ queryAllCreatedOsAccounts(callback: AsyncCallback>): void; queryAllCreatedOsAccounts(): Promise>; @@ -298,7 +300,7 @@ declare namespace osAccount { * @since 7 * @param localId Indicates the local ID of the OS account. * @return Returns the OS account information; returns {@code null} if the query fails. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS/ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION. * @systemapi Hide this for inner system use. */ queryOsAccountById(localId: number, callback: AsyncCallback): void; @@ -325,7 +327,7 @@ declare namespace osAccount { * * @since 7 * @return Returns the DVID if obtained; returns an empty string if no OHOS account has logged in. - * @permission ohos.permission.DISTRIBUTED_DATASYNC. + * @permission ohos.permission.DISTRIBUTED_DATASYNC or ohos.permission.MANAGE_LOCAL_ACCOUNTS */ getDistributedVirtualDeviceId(callback: AsyncCallback): void; getDistributedVirtualDeviceId(): Promise; 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.inputmethod.d.ts b/api/@ohos.inputmethod.d.ts index 2ec69c2eeb4b37a92c26744b2e753eb227fa02a3..44114b10f16b3386a8a409acc10bcc5d3362039f 100644 --- a/api/@ohos.inputmethod.d.ts +++ b/api/@ohos.inputmethod.d.ts @@ -19,7 +19,7 @@ import {AsyncCallback} from './basic'; * inputmethod * * @since 6 - * @syscap SystemCapability.MiscServices.InputMethodFramework + * @syscap SystemCapability.Miscservices.InputMethodFramework */ declare namespace inputMethod { const MAX_TYPE_NUM: number diff --git a/api/@ohos.inputmethodengine.d.ts b/api/@ohos.inputmethodengine.d.ts index 0f11096d63625ec99043161ed79b591e983e3ef9..19b7beac09676a0fbd5cbecd3a9499c641069399 100644 --- a/api/@ohos.inputmethodengine.d.ts +++ b/api/@ohos.inputmethodengine.d.ts @@ -19,7 +19,7 @@ import {AsyncCallback} from './basic'; * inputmethodengine * * @since 8 - * @syscap SystemCapability.MiscServices.InputMethodFramework + * @syscap SystemCapability.Miscservices.InputMethodFramework */ declare namespace inputMethodEngine { const ENTER_KEY_TYPE_UNSPECIFIED: number; @@ -58,7 +58,7 @@ declare namespace inputMethodEngine { function createKeyboardDelegate(): KeyboardDelegate; interface KeyboardController { - hideKeyboard(callbakc: AsyncCallback): void; + hideKeyboard(callback: AsyncCallback): void; hideKeyboard(): Promise; } @@ -86,15 +86,15 @@ declare namespace inputMethodEngine { deleteBackward(length: number): Promise; - InsertText(text: string, callback: AsyncCallback): void; + insertText(text: string, callback: AsyncCallback): void; - InsertText(text: string): Promise; + insertText(text: string): Promise; getForward(length: number, callback: AsyncCallback): void; getForward(length: number): Promise; - getEditorAttribute(lcallback: AsyncCallback): void; + getEditorAttribute(callback: AsyncCallback): void; getEditorAttribute(): Promise; } diff --git a/api/@ohos.multimedia.media.d.ts b/api/@ohos.multimedia.media.d.ts index b39c129aefaf02b6bb9703fa2d3ac3110139ce3a..fc6bddcc14de8c88cd902d9a0717eb78600f026c 100644 --- a/api/@ohos.multimedia.media.d.ts +++ b/api/@ohos.multimedia.media.d.ts @@ -831,6 +831,7 @@ declare namespace media { * @since 8 * @syscap SystemCapability.Multimedia.Media.VideoPlayer * @param callback A callback instance used to return when prepare completed. + * @permission ohos.permission.MICROPHONE */ prepare(callback: AsyncCallback): void; /** @@ -838,6 +839,7 @@ declare namespace media { * @since 8 * @syscap SystemCapability.Multimedia.Media.VideoPlayer * @return A Promise instance used to return when prepare completed. + * @permission ohos.permission.MICROPHONE */ prepare(): 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.power.d.ts b/api/@ohos.power.d.ts index 5f59da72f5ad0406eb6b09f4d603f6dee2447a9b..3b7db0d372d0086ee9a1aaafdb2ad92fc3cb5b55 100644 --- a/api/@ohos.power.d.ts +++ b/api/@ohos.power.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -25,9 +25,10 @@ declare namespace power { /** * Shuts down the system. * - *

This method requires the ohos.permission.SHUTDOWN permission. + *

This method requires the ohos.permission.REBOOT permission. * * @param reason Indicates the shutdown reason. + * @permission ohos.permission.REBOOT * @systemapi * @since 7 */ @@ -40,6 +41,7 @@ declare namespace power { * * @param reason Indicates the restart reason. For example, "updater" indicates entering the updater mode * after the restart. If the parameter is not specified, the system enters the normal mode after the restart. + * @permission ohos.permission.REBOOT * @since 7 */ function rebootDevice(reason: string): void; diff --git a/api/@ohos.rpc.d.ts b/api/@ohos.rpc.d.ts index 8eb9819c9aa837d77419684cfcfd27bb40cf88c3..6f7784700a616fca1680235c17746afa5959b49f 100644 --- a/api/@ohos.rpc.d.ts +++ b/api/@ohos.rpc.d.ts @@ -976,7 +976,7 @@ declare namespace rpc { * Indicates the wait time for RPC, in seconds. It is NOT used in IPC case. * @since 7 */ - TF_WAIT_TIME = 8; + TF_WAIT_TIME = 4; /** * A constructor used to create a MessageOption instance. diff --git a/api/@ohos.runninglock.d.ts b/api/@ohos.runninglock.d.ts index 1fddf45940ebfb69c694249e1053b6e22e0b4f97..9f9c4b49790d90158e8bf55ac44cdb792e13b883 100644 --- a/api/@ohos.runninglock.d.ts +++ b/api/@ohos.runninglock.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -31,9 +31,11 @@ declare namespace runningLock { class RunningLock { /** * Prevents the system from hibernating and sets the lock duration. + * This method requires the ohos.permission.RUNNING_LOCK permission. * * @param timeout Indicates the lock duration (ms). After the lock duration times out, the lock is automatically * released and the system hibernates if no other {@link RunningLock} is set. + * @permission ohos.permission.RUNNING_LOCK * @since 7 */ lock(timeout: number): void; @@ -48,8 +50,10 @@ declare namespace runningLock { /** * Release the {@link RunningLock} that prevents the system from hibernating. + * This method requires the ohos.permission.RUNNING_LOCK permission. * * @since 7 + * @permission ohos.permission.RUNNING_LOCK */ unlock(): void; } @@ -98,6 +102,7 @@ declare namespace runningLock { * a suffix. * @param type Indicates the {@link RunningLockType}. * @return Returns the {@link RunningLock} object. + * @permission ohos.permission.RUNNING_LOCK * @since 7 */ function createRunningLock(name: string, type: RunningLockType, callback: AsyncCallback): void; diff --git a/api/@ohos.settings.d.ts b/api/@ohos.settings.d.ts index 09fcc58b9f587c91a80a4c0adcc3550cbbeeab6f..686221b16cb996909ddef50c1d478e9e72c7dd15 100644 --- a/api/@ohos.settings.d.ts +++ b/api/@ohos.settings.d.ts @@ -805,7 +805,7 @@ declare namespace settings { * @param value Indicates the value of the character string. * @return Returns {@code true} if the operation is successful; returns {@code false} otherwise. * @since 7 - * @systemapi Hide this for inner system use. + * @systemapi Hide this for inner system use. SystemApi */ function setValue(dataAbilityHelper: DataAbilityHelper, name: string, value: object, callback: AsyncCallback): void; function setValue(dataAbilityHelper: DataAbilityHelper, name: string, value: object): Promise; 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 */