diff --git a/en/application-dev/reference/apis/Readme-EN.md b/en/application-dev/reference/apis/Readme-EN.md index bb3eca101141cf2fcc13c880bc7edd69173d02d7..467463fb29348384d791291ac350848b8fe908d3 100644 --- a/en/application-dev/reference/apis/Readme-EN.md +++ b/en/application-dev/reference/apis/Readme-EN.md @@ -109,7 +109,7 @@ - [MissionSnapshot](js-apis-inner-application-missionSnapshot.md) - [ProcessData](js-apis-inner-application-processData.md) - [ProcessRunningInfo](js-apis-inner-application-processRunningInfo.md) - - [ProcessRunningInformation](js-apis-inner-application-processRunningInformation.md) + - [ProcessInformation](js-apis-inner-application-processInformation.md) - [ServiceExtensionContext](js-apis-inner-application-serviceExtensionContext.md) - [UIAbilityContext](js-apis-inner-application-uiAbilityContext.md) - [shellCmdResult](js-apis-inner-application-shellCmdResult.md) @@ -152,7 +152,6 @@ - [hapModuleInfo](js-apis-bundleManager-hapModuleInfo.md) - [launcherAbilityInfo](js-apis-bundleManager-launcherAbilityInfo.md) - [metadata](js-apis-bundleManager-metadata.md) - - [packInfo](js-apis-bundleManager-packInfo.md) - [permissionDef](js-apis-bundleManager-permissionDef.md) - [remoteAbilityInfo](js-apis-bundleManager-remoteAbilityInfo.md) - [shortcutInfo](js-apis-bundleManager-shortcutInfo.md) @@ -185,7 +184,7 @@ - [@ohos.i18n (Internationalization)](js-apis-i18n.md) - [@ohos.intl (Internationalization)](js-apis-intl.md) - [@ohos.resourceManager (Resource Manager)](js-apis-resource-manager.md) -- Resource Scheduling +- Background Tasks - [@ohos.distributedMissionManager (Distributed Mission Management)](js-apis-distributedMissionManager.md) - [@ohos.reminderAgentManager (Reminder Agent Management)](js-apis-reminderAgentManager.md) - [@ohos.resourceschedule.backgroundTaskManager (Background Task Management)](js-apis-resourceschedule-backgroundTaskManager.md) @@ -211,7 +210,7 @@ - [@ohos.data.distributedDataObject (Distributed Data Object)](js-apis-data-distributedobject.md) - [@ohos.data.distributedKVStore (Distributed KV Store)](js-apis-distributedKVStore.md) - [@ohos.data.preferences (Preferences)](js-apis-data-preferences.md) - - [@ohos.data.relationalStore (关系型数据库)](js-apis-data-relationalStore.md) + - [@ohos.data.relationalStore (RDB Store)](js-apis-data-relationalStore.md) - [@ohos.data.ValuesBucket (Value Bucket)](js-apis-data-valuesBucket.md) - data/rdb - [resultSet](js-apis-data-resultset.md) @@ -371,6 +370,7 @@ - [@ohos.statfs (statfs)](js-apis-statfs.md) - [@ohos.systemParameter (System Parameter)](js-apis-system-parameter.md) - [@ohos.usb (USB Management)](js-apis-usb-deprecated.md) + - [@ohos.usbV9 (USB Management)](js-apis-usb.md) - [@system.app (Application Context)](js-apis-system-app.md) - [@system.battery (Battery Information)](js-apis-system-battery.md) - [@system.bluetooth (Bluetooth)](js-apis-system-bluetooth.md) diff --git a/en/application-dev/reference/apis/js-apis-Bundle-distributedBundle.md b/en/application-dev/reference/apis/js-apis-Bundle-distributedBundle.md index b9802806f7c88d2ccc9fa4a78726a434593b5e21..eda69bbe8857d6d787753bc91247dcde124f9633 100644 --- a/en/application-dev/reference/apis/js-apis-Bundle-distributedBundle.md +++ b/en/application-dev/reference/apis/js-apis-Bundle-distributedBundle.md @@ -26,7 +26,7 @@ For details, see [Permission Levels](../../security/accesstoken-overview.md#perm ## distributedBundle.getRemoteAbilityInfodeprecated -> This API is deprecated since API version 9. You are advised to use [getRemoteAbilityInfo(@ohos.bundle.distributedBundle)](js-apis-distributedBundle.md) instead. +> This API is deprecated since API version 9. You are advised to use [getRemoteAbilityInfo(@ohos.bundle.distributedBundleManager)](js-apis-distributedBundleManager.md) instead. getRemoteAbilityInfo(elementName: ElementName, callback: AsyncCallback<RemoteAbilityInfo>): void; @@ -55,7 +55,7 @@ This is a system API and cannot be called by third-party applications. ## distributedBundle.getRemoteAbilityInfodeprecated -> This API is deprecated since API version 9. You are advised to use [getRemoteAbilityInfo(@ohos.bundle.distributedBundle)](js-apis-distributedBundle.md) instead. +> This API is deprecated since API version 9. You are advised to use [getRemoteAbilityInfo(@ohos.bundle.distributedBundleManager)](js-apis-distributedBundleManager.md) instead. getRemoteAbilityInfo(elementName: ElementName): Promise<RemoteAbilityInfo> @@ -87,7 +87,7 @@ This is a system API and cannot be called by third-party applications. ## distributedBundle.getRemoteAbilityInfosdeprecated -> This API is deprecated since API version 9. You are advised to use [getRemoteAbilityInfo(@ohos.bundle.distributedBundle)](js-apis-distributedBundle.md) instead. +> This API is deprecated since API version 9. You are advised to use [getRemoteAbilityInfo(@ohos.bundle.distributedBundleManager)](js-apis-distributedBundleManager.md) instead. getRemoteAbilityInfos(elementNames: Array<ElementName>, callback: AsyncCallback<Array<RemoteAbilityInfo>>): void; @@ -116,7 +116,7 @@ This is a system API and cannot be called by third-party applications. ## distributedBundle.getRemoteAbilityInfosdeprecated -> This API is deprecated since API version 9. You are advised to use [getRemoteAbilityInfo(@ohos.bundle.distributedBundle)](js-apis-distributedBundle.md) instead. +> This API is deprecated since API version 9. You are advised to use [getRemoteAbilityInfo(@ohos.bundle.distributedBundleManager)](js-apis-distributedBundleManager.md) instead. getRemoteAbilityInfos(elementNames: Array<ElementName>): Promise<Array<RemoteAbilityInfo>> diff --git a/en/application-dev/reference/apis/js-apis-app-form-formExtensionAbility.md b/en/application-dev/reference/apis/js-apis-app-form-formExtensionAbility.md index ef4e93e215b868013f025722737472735a1016f7..977e098243a124daa3c8184dea1a5878d0b33e1d 100644 --- a/en/application-dev/reference/apis/js-apis-app-form-formExtensionAbility.md +++ b/en/application-dev/reference/apis/js-apis-app-form-formExtensionAbility.md @@ -1,6 +1,6 @@ # @ohos.app.form.FormExtensionAbility (FormExtensionAbility) -The **FormExtensionAbility** module provides lifecycle callbacks invoked when a widget is created, destroyed, or updated. +The **FormExtensionAbility** module provides APIs related to FormExtensionAbilities. > **NOTE** > @@ -19,7 +19,7 @@ import FormExtensionAbility from '@ohos.app.form.FormExtensionAbility'; | Name | Type | Readable| Writable| Description | | ------- | ------------------------------------------------------------ | ---- | ---- | ------------------------------------------------------------ | -| context | [FormExtensionContext](js-apis-inner-application-formExtensionContext.md) | Yes | No | Context of the FormExtensionAbility. This context is inherited from [ExtensionContext](js-apis-inner-application-extensionContext.md).| +| context | [FormExtensionContext](js-apis-inner-application-formExtensionContext.md) | Yes | No | Context of the FormExtensionAbility. This context is inherited from **ExtensionContext**.| ## onAddForm @@ -33,7 +33,7 @@ Called to notify the widget provider that a **Form** instance (widget) has been | Name| Type | Mandatory| Description | | ------ | -------------------------------------- | ---- | ------------------------------------------------------------ | -| want | [Want](js-apis-application-want.md) | Yes | Want information related to the FormExtensionAbility, including the widget ID, name, and style. The information must be managed as persistent data to facilitate subsequent widget update and deletion.| +| want | [Want](js-apis-application-want.md) | Yes | Want information related to the ExtensionAbility, including the widget ID, name, and style. The information must be managed as persistent data to facilitate subsequent widget update and deletion.| **Return value** @@ -45,19 +45,17 @@ Called to notify the widget provider that a **Form** instance (widget) has been ```ts import FormExtensionAbility from '@ohos.app.form.FormExtensionAbility'; -import formBindingData from '@ohos.app.form.formBindingData'; - export default class MyFormExtensionAbility extends FormExtensionAbility { onAddForm(want) { console.log('FormExtensionAbility onAddForm, want:' + want.abilityName); let dataObj1 = { - temperature: "11c", - "time": "11:00" + temperature:'11c', + 'time':'11:00' }; let obj1 = formBindingData.createFormBindingData(dataObj1); return obj1; } -}; +} ``` ## onCastToNormalForm @@ -77,20 +75,18 @@ Called to notify the widget provider that a temporary widget has been converted **Example** ```ts -import FormExtensionAbility from '@ohos.app.form.FormExtensionAbility'; - export default class MyFormExtensionAbility extends FormExtensionAbility { onCastToNormalForm(formId) { console.log('FormExtensionAbility onCastToNormalForm, formId:' + formId); } -}; +} ``` ## onUpdateForm onUpdateForm(formId: string): void -Called to notify the widget provider that a widget has been updated. After obtaining the latest data, your application should call [updateForm](js-apis-app-form-formProvider.md#updateform) of **formProvider** to update the widget data. +Called to notify the widget provider that a widget has been updated. After obtaining the latest data, your application should call **updateForm** of [FormExtensionContext](js-apis-inner-application-formExtensionContext.md) to update the widget data. **System capability**: SystemCapability.Ability.Form @@ -103,24 +99,17 @@ Called to notify the widget provider that a widget has been updated. After obtai **Example** ```ts -import FormExtensionAbility from '@ohos.app.form.FormExtensionAbility'; import formBindingData from '@ohos.app.form.formBindingData'; -import formProvider from '@ohos.app.form.formProvider'; - export default class MyFormExtensionAbility extends FormExtensionAbility { onUpdateForm(formId) { console.log('FormExtensionAbility onUpdateForm, formId:' + formId); - let obj2 = formBindingData.createFormBindingData({ - temperature: "22c", - time: "22:00" - }); - formProvider.updateForm(formId, obj2).then((data) => { + let obj2 = formBindingData.createFormBindingData({temperature:'22c', time:'22:00'}); + this.context.updateForm(formId, obj2).then((data)=>{ console.log('FormExtensionAbility context updateForm, data:' + data); }).catch((error) => { - console.error('Operation updateForm failed. Cause: ' + error); - }); - } -}; + console.error('Operation updateForm failed. Cause: ' + error);}); + } +} ``` ## onChangeFormVisibility @@ -140,28 +129,21 @@ Called to notify the widget provider of the change of visibility. **Example** ```ts -import FormExtensionAbility from '@ohos.app.form.FormExtensionAbility'; -import formBindingData from '@ohos.app.form.formBindingData' -import formProvider from '@ohos.app.form.formProvider'; - +import formBindingData from '@ohos.app.form.formBindingData'; export default class MyFormExtensionAbility extends FormExtensionAbility { onChangeFormVisibility(newStatus) { - console.log('FormExtensionAbility onChangeFormVisibility, newStatus:' + newStatus); - let obj2 = formBindingData.createFormBindingData({ - temperature: "22c", - time: "22:00" - }); - - for (let key in newStatus) { - console.log('FormExtensionAbility onChangeFormVisibility, key:' + key + ", value=" + newStatus[key]); - formProvider.updateForm(key, obj2).then((data) => { + console.log('FormExtensionAbility onChangeFormVisibility, newStatus:' + newStatus); + let obj2 = formBindingData.createFormBindingData({temperature:'22c', time:'22:00'}); + + for (let key in newStatus) { + console.log('FormExtensionAbility onChangeFormVisibility, key:' + key + ', value=' + newStatus[key]); + this.context.updateForm(key, obj2).then((data)=>{ console.log('FormExtensionAbility context updateForm, data:' + data); - }).catch((error) => { - console.error('Operation updateForm failed. Cause: ' + error); - }); + }).catch((error) => { + console.error('Operation updateForm failed. Cause: ' + error);}); } } -}; +} ``` ## onFormEvent @@ -182,13 +164,11 @@ Called to instruct the widget provider to receive and process the widget event. **Example** ```ts -import FormExtensionAbility from '@ohos.app.form.FormExtensionAbility'; - -export default class MyFormExtensionAbility extends FormExtensionAbility { +export default class MyFormExtension extends FormExtensionAbility { onFormEvent(formId, message) { - console.log('FormExtensionAbility onFormEvent, formId:' + formId + ", message:" + message); + console.log('FormExtensionAbility onFormEvent, formId:' + formId + ', message:' + message); } -}; +} ``` ## onRemoveForm @@ -208,13 +188,11 @@ Called to notify the widget provider that a **Form** instance (widget) has been **Example** ```ts -import FormExtensionAbility from '@ohos.app.form.FormExtensionAbility'; - export default class MyFormExtensionAbility extends FormExtensionAbility { onRemoveForm(formId) { console.log('FormExtensionAbility onRemoveForm, formId:' + formId); } -}; +} ``` ## onConfigurationUpdate @@ -234,13 +212,11 @@ Called when the configuration of the environment where the ability is running is **Example** ```ts -import FormExtensionAbility from '@ohos.app.form.FormExtensionAbility'; - -export default class MyFormExtensionAbility extends FormExtensionAbility { +class MyFormExtensionAbility extends FormExtensionAbility { onConfigurationUpdate(config) { console.log('onConfigurationUpdate, config:' + JSON.stringify(config)); } -}; +} ``` ## onAcquireFormState @@ -260,15 +236,13 @@ Called when the widget provider receives the status query result of a widget. By **Example** ```ts -import FormExtensionAbility from '@ohos.app.form.FormExtensionAbility'; import formInfo from '@ohos.app.form.formInfo'; - -export default class MyFormExtensionAbility extends FormExtensionAbility { +class MyFormExtensionAbility extends FormExtensionAbility { onAcquireFormState(want) { console.log('FormExtensionAbility onAcquireFormState, want:' + want); return formInfo.FormState.UNKNOWN; } -}; +} ``` ## onShareForm @@ -296,16 +270,14 @@ Called by the widget provider to receive shared widget data. **Example** ```ts -import FormExtensionAbility from '@ohos.app.form.FormExtensionAbility'; - -export default class MyFormExtensionAbility extends FormExtensionAbility { +class MyFormExtensionAbility extends FormExtensionAbility { onShareForm(formId) { console.log('FormExtensionAbility onShareForm, formId:' + formId); let wantParams = { - "temperature": "20", - "time": "2022-8-8 09:59", + 'temperature':'20', + 'time':'2022-8-8 09:59', }; return wantParams; } -}; +} ``` diff --git a/en/application-dev/reference/apis/js-apis-application-AccessibilityExtensionAbility.md b/en/application-dev/reference/apis/js-apis-application-accessibilityExtensionAbility.md similarity index 100% rename from en/application-dev/reference/apis/js-apis-application-AccessibilityExtensionAbility.md rename to en/application-dev/reference/apis/js-apis-application-accessibilityExtensionAbility.md diff --git a/en/application-dev/reference/apis/js-apis-application-context.md b/en/application-dev/reference/apis/js-apis-application-context.md deleted file mode 100644 index d42e522c14266de6ca53fff7370c68de14c34d36..0000000000000000000000000000000000000000 --- a/en/application-dev/reference/apis/js-apis-application-context.md +++ /dev/null @@ -1,41 +0,0 @@ -# @ohos.application.context (Context) - -The **Context** module provides all level-2 module APIs for developers to export. - -> **NOTE** -> -> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. -> The APIs of this module can be used only in the stage model. - -## Modules to Import - -```ts -import context from '@ohos.application.context' -``` - -**System capability**: SystemCapability.Ability.AbilityBase - -| Name | Readable/Writable| Type | Mandatory| Description | -| ----------- | -------- | -------------------- | ---- | ------------------------------------------------------------ | -| AbilityContext | Read Only | [AbilityContext](js-apis-ability-context.md) | No | Level-2 module **AbilityContext**. | -| AbilityStageContext | Read Only | [AbilityStageContext](js-apis-inner-application-abilityStageContext.md) | No | Level-2 module **AbilityStageContext**.| -| ApplicationContext | Read Only | [ApplicationContext](js-apis-inner-application-applicationContext.md) | No | Level-2 module **ApplicationContext**.| -| BaseContext | Read Only | [BaseContext](js-apis-inner-application-baseContext.md) | No | Level-2 module **BaseContext**.| -| Context | Read Only | [Context](js-apis-inner-application-context.md) | No | Level-2 module **Context**.| -| ExtensionContext | Read Only | [ExtensionContext](js-apis-inner-application-extensionContext.md) | No | Level-2 module **ExtensionContext**.| -| FormExtensionContext | Read Only | [FormExtensionContext](js-apis-inner-application-formExtensionContext.md) | No | Level-2 module **FormExtensionContext**.| -| EventHub | Read Only | [EventHub](js-apis-inner-application-eventHub.md) | No | Level-2 module **EventHub**.| -| PermissionRequestResult | Read Only | [PermissionRequestResult](js-apis-inner-application-permissionRequestResult.md) | No | Level-2 module **PermissionRequestResult**.| - -**Example** -```ts -let abilityContext: context.AbilityContext; -let abilityStageContext: context.AbilityStageContext; -let applicationContext: context.ApplicationContext; -let baseContext: context.BaseContext; -let context: context.Context; -let extensionContext: context.ExtensionContext; -let formExtensionContext: context.FormExtensionContext; -let eventHub: context.EventHub; -let permissionRequestResult: context.PermissionRequestResult; -``` diff --git a/en/application-dev/reference/apis/js-apis-application-EnvironmentCallback.md b/en/application-dev/reference/apis/js-apis-application-environmentCallback.md similarity index 100% rename from en/application-dev/reference/apis/js-apis-application-EnvironmentCallback.md rename to en/application-dev/reference/apis/js-apis-application-environmentCallback.md diff --git a/en/application-dev/reference/apis/js-apis-application-extensionAbility.md b/en/application-dev/reference/apis/js-apis-application-extensionAbility.md deleted file mode 100644 index f18b293edd8d7a4f65684bc38df4fe48498fa11b..0000000000000000000000000000000000000000 --- a/en/application-dev/reference/apis/js-apis-application-extensionAbility.md +++ /dev/null @@ -1,62 +0,0 @@ -# @ohos.application.ExtensionAbility (ExtensionAbility) - -The **ExtensionAbility** module manages the ExtensionAbility lifecycle and context, such as creating and destroying an ExtensionAbility, and dumping client information. - -> **NOTE** -> -> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. -> The APIs of this module can be used only in the stage model. - -## Modules to Import - -```ts -import ExtensionAbility from '@ohos.application.ExtensionAbility'; -``` - -## ExtensionAbility.onConfigurationUpdated - -onConfigurationUpdated(newConfig: Configuration): void; - -Called when the configuration of the environment where the ability is running is updated. - -**System capability**: SystemCapability.Ability.AbilityRuntime.Core - -**Parameters** - - | Name| Type| Mandatory| Description| - | -------- | -------- | -------- | -------- | - | newConfig | [Configuration](js-apis-application-configuration.md) | Yes| New configuration.| - -**Example** - - ```ts - class MyExtensionAbility extends ExtensionAbility { - onConfigurationUpdated(config) { - console.log('onConfigurationUpdated, config:' + JSON.stringify(config)); - } - } - ``` - -## ExtensionAbility.onMemoryLevel - -onMemoryLevel(level: AbilityConstant.MemoryLevel): void; - -Called when the system has decided to adjust the memory level. For example, this API can be used when there is not enough memory to run as many background processes as possible. - -**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore - -**Parameters** - - | Name| Type| Mandatory| Description| - | -------- | -------- | -------- | -------- | - | level | [AbilityConstant.MemoryLevel](js-apis-application-abilityConstant.md#abilityconstantmemorylevel) | Yes| Memory level that indicates the memory usage status. When the specified memory level is reached, a callback will be invoked and the system will start adjustment.| - -**Example** - - ```ts - class MyExtensionAbility extends ExtensionAbility { - onMemoryLevel(level) { - console.log('onMemoryLevel, level:' + JSON.stringify(level)); - } - } - ``` diff --git a/en/application-dev/reference/apis/js-apis-application-StartOptions.md b/en/application-dev/reference/apis/js-apis-application-startOptions.md similarity index 100% rename from en/application-dev/reference/apis/js-apis-application-StartOptions.md rename to en/application-dev/reference/apis/js-apis-application-startOptions.md diff --git a/en/application-dev/reference/apis/js-apis-application-Want.md b/en/application-dev/reference/apis/js-apis-application-want.md similarity index 100% rename from en/application-dev/reference/apis/js-apis-application-Want.md rename to en/application-dev/reference/apis/js-apis-application-want.md diff --git a/en/application-dev/reference/apis/js-apis-application-WindowExtensionAbility.md b/en/application-dev/reference/apis/js-apis-application-windowExtensionAbility.md similarity index 100% rename from en/application-dev/reference/apis/js-apis-application-WindowExtensionAbility.md rename to en/application-dev/reference/apis/js-apis-application-windowExtensionAbility.md diff --git a/en/application-dev/reference/apis/js-apis-bundleManager-applicationInfo.md b/en/application-dev/reference/apis/js-apis-bundleManager-applicationInfo.md index 667bb6bb46bf30891e2eb03336a1ec8266e57c24..d87ee5597f2535ec83113f16775dbd33a7a623ba 100644 --- a/en/application-dev/reference/apis/js-apis-bundleManager-applicationInfo.md +++ b/en/application-dev/reference/apis/js-apis-bundleManager-applicationInfo.md @@ -21,9 +21,9 @@ The **ApplicationInfo** module defines the application information. A system app | icon | string | Yes | No | Application icon. | | iconId | number | Yes | No | ID of the application icon. | | process | string | Yes | No | Process in which the application runs. If this parameter is not set, the bundle name is used. | -| permissions | Array\ | Yes | No | Permissions required for accessing the application. The permissions can be obtained by passing in **GET_APPLICATION_INFO_WITH_PERMISSION** to the **appFlags** parameter of [bundleManager.getApplicationInfo](js-apis-bundleManager.md#bundlemanagergetapplicationinfo).| +| permissions | Array\ | Yes | No | Permissions required for accessing the application. The permissions can be obtained by passing in **GET_APPLICATION_INFO_WITH_PERMISSION** to [bundleManager.getApplicationInfo](js-apis-bundleManager.md#bundlemanagergetapplicationinfo).| | codePath | string | Yes | No | Installation directory of the application. | -| metadata | Map\> | Yes | No | Metadata of the application. The information can be obtained by passing in **GET_APPLICATION_INFO_WITH_METADATA** to the **appFlags** parameter of [bundleManager.getApplicationInfo](js-apis-bundleManager.md#bundlemanagergetapplicationinfo).| +| metadata | Map\> | Yes | No | Metadata of the application. The information can be obtained by passing in **GET_APPLICATION_INFO_WITH_METADATA** to [bundleManager.getApplicationInfo](js-apis-bundleManager.md#bundlemanagergetapplicationinfo).| | removable | boolean | Yes | No | Whether the application is removable. | | accessTokenId | number | Yes | No | Access token ID of the application. | | uid | number | Yes | No | UID of the application. | @@ -32,3 +32,4 @@ The **ApplicationInfo** module defines the application information. A system app | descriptionResource | [Resource](js-apis-resource-manager.md#resource9) | Yes| No| Description resource of the application. | | appDistributionType | string | Yes | No | Distribution type of the application signing certificate. The options are **app_gallery**, **enterprise**, **os_integration**, and **crowdtesting**. | | appProvisionType | string | Yes | No | Type of the application signing certificate file. The options are **debug** and **release**. | +| systemApp | boolean | Yes | No | Whether the application is a system application. | diff --git a/en/application-dev/reference/apis/js-apis-bundleManager-bundleInfo.md b/en/application-dev/reference/apis/js-apis-bundleManager-bundleInfo.md index 8e6821b79eb36a6bd93dd9aed2b9016a3029dad2..5ac1f36f06bc8cab683227b26bcacab465323408 100644 --- a/en/application-dev/reference/apis/js-apis-bundleManager-bundleInfo.md +++ b/en/application-dev/reference/apis/js-apis-bundleManager-bundleInfo.md @@ -6,8 +6,6 @@ The **BundleInfo** module defines the bundle information. A system application c > > The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. - - ## BundleInfo **System capability**: SystemCapability.BundleManager.BundleFramework.Core diff --git a/en/application-dev/reference/apis/js-apis-bundleManager-extensionAbilityInfo.md b/en/application-dev/reference/apis/js-apis-bundleManager-extensionAbilityInfo.md index 016b7af13fded843c7c85f05834669aa5e45c2bd..7ed2eac254782a4616a51cf0dfdfc02a46ac70f3 100644 --- a/en/application-dev/reference/apis/js-apis-bundleManager-extensionAbilityInfo.md +++ b/en/application-dev/reference/apis/js-apis-bundleManager-extensionAbilityInfo.md @@ -1,6 +1,6 @@ # ExtensionAbilityInfo -The **ExtensionAbilityInfo** module defines the ExtensionAbility information. A system application can obtain its own or others' ExtensionAbility information through [bundleManager.getBundleInfo](js-apis-bundleManager.md#bundlemanagergetbundleinfo). A third-party application can obtain its own ExtensionAbility information through [getBundleInfoForSelf](js-apis-bundleManager.md#bundlemanagergetbundleinfoforself). **GET_BUNDLE_INFO_WITH_EXTENSION_ABILITY** must be passed in to the input parameter [bundleFlags](js-apis-bundleManager.md#bundleflag) to obtain the information. +The **ExtensionAbilityInfo** module defines the ExtensionAbility information. A system application can obtain its own or others' ExtensionAbility information through [bundleManager.getBundleInfo](js-apis-bundleManager.md#bundlemanagergetbundleinfo). A third-party application can obtain its own ExtensionAbility information through [getBundleInfoForSelf](js-apis-bundleManager.md#bundlemanagergetbundleinfoforself). The input parameter [bundleFlags](js-apis-bundleManager.md#bundleflag) must be set to **GET_BUNDLE_INFO_WITH_EXTENSION_ABILITY**. > **NOTE** > @@ -18,7 +18,7 @@ The **ExtensionAbilityInfo** module defines the ExtensionAbility information. A | labelId | number | Yes | No | ID of the ExtensionAbility label. | | descriptionId | number | Yes | No | ID of the ExtensionAbility description. | | iconId | number | Yes | No | ID of the ExtensionAbility icon. | -| isVisible | boolean | Yes | No | Whether the ExtensionAbility can be called by other bundles. | +| exported | boolean | Yes | No | Whether the ExtensionAbility can be called by other bundles. | | extensionAbilityType | [ExtensionAbilityType](js-apis-bundleManager.md#extensionabilitytype) | Yes | No | Type of the ExtensionAbility. | | permissions | Array\ | Yes | No | Permissions required for other bundles to call the ExtensionAbility.| | applicationInfo | [ApplicationInfo](js-apis-bundleManager-applicationInfo.md) | Yes | No | Application information. | diff --git a/en/application-dev/reference/apis/js-apis-bundleManager-hapModuleInfo.md b/en/application-dev/reference/apis/js-apis-bundleManager-hapModuleInfo.md index 8fe0cc4768b4b0ac352fcd98d9cefad9cc2c1553..146e3da56069f96ce10e20a62b9d2474bc51508a 100644 --- a/en/application-dev/reference/apis/js-apis-bundleManager-hapModuleInfo.md +++ b/en/application-dev/reference/apis/js-apis-bundleManager-hapModuleInfo.md @@ -1,6 +1,6 @@ # HapModuleInfo -The **HapModuleInfo** module defines the HAP module information. A system application can obtain its own or others' HAP module information through [bundleManager.getBundleInfo](js-apis-bundleManager.md#bundlemanagergetbundleinfo). A third-party application can obtain its own HAP module information through [getBundleInfoForSelf](js-apis-bundleManager.md#bundlemanagergetbundleinfoforself). **GET_BUNDLE_INFO_WITH_HAP_MODULE** must be passed in to the input parameter [bundleFlags](js-apis-bundleManager.md#bundleflag) to obtain the information. +The **HapModuleInfo** module defines the HAP module information. A system application can obtain its own or others' HAP module information through [bundleManager.getBundleInfo](js-apis-bundleManager.md#bundlemanagergetbundleinfo). A third-party application can obtain its own HAP module information through [getBundleInfoForSelf](js-apis-bundleManager.md#bundlemanagergetbundleinfoforself). The input parameter [bundleFlags](js-apis-bundleManager.md#bundleflag) must be set to **GET_BUNDLE_INFO_WITH_HAP_MODULE**. > **NOTE** > diff --git a/en/application-dev/reference/apis/js-apis-bundleManager-packInfo.md b/en/application-dev/reference/apis/js-apis-bundleManager-packInfo.md deleted file mode 100644 index a9e4c359659c55169acdbf0e3bc8f583b67febe9..0000000000000000000000000000000000000000 --- a/en/application-dev/reference/apis/js-apis-bundleManager-packInfo.md +++ /dev/null @@ -1,146 +0,0 @@ -# PackInfo - -The **PackInfo** module provides information in the **pack.info** file. The information can be obtained using [freeInstall.getBundlePackInfo](js-apis-freeInstall.md). - -> **NOTE** -> -> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. - -## BundlePackInfo - -**System API**: This is a system API. - -**System capability**: SystemCapability.BundleManager.BundleFrameWork.FreeInstall - - -| Name | Type | Readable| Writable| Description | -| -------- | --------------------------------------- | ---- | ---- | ------------------------- | -| packages | Array\<[PackageConfig](#packageconfig)> | Yes | No | Package configuration information in the **pack.info** file. | -| summary | [PackageSummary](#packagesummary) | Yes | No | Package summary information in the **pack.info** file.| - -## PackageConfig - -**System API**: This is a system API. - -**System capability**: SystemCapability.BundleManager.BundleFrameWork.FreeInstall - -| Name | Type | Readable| Writable| Description | -| ------------------- | -------------- | ---- | ---- | ------------------------------------------------------------ | -| deviceTypes | Array\ | Yes | No | Device types supported by the bundle. | -| name | string | Yes | No | Bundle name. | -| moduleType | string | Yes | No | Module type of the bundle. | -| deliveryWithInstall | boolean | Yes | No | Whether the HAP file will be installed when the user installs the bundle. The value **true** means that the HAP file will be automatically installed when the user installs the bundle, and **false** means the opposite.| - -## PackageSummary - -**System API**: This is a system API. - -**System capability**: SystemCapability.BundleManager.BundleFrameWork.FreeInstall - -| Name | Type | Readable| Writable| Description | -| ------- | --------------------------------------------- | ---- | ---- | -------------------- | -| app | [BundleConfigInfo](#bundleconfiginfo) | Yes | No | Bundle configuration information. | -| modules | Array\<[ModuleConfigInfo](#moduleconfiginfo)> | Yes | No | Module configuration information of the bundle.| - -## BundleConfigInfo - -**System API**: This is a system API. - -**System capability**: SystemCapability.BundleManager.BundleFrameWork.FreeInstall - -| Name | Type | Readable| Writable| Description | -| ---------- | ------------------- | ---- | ---- | -------------------------------------- | -| bundleName | string | Yes | No | Bundle name. It uniquely identifies an application.| -| version | [Version](#version) | Yes | No | Bundle version. | - -## ModuleConfigInfo - -**System API**: This is a system API. - -**System capability**: SystemCapability.BundleManager.BundleFrameWork.FreeInstall - -| Name | Type | Readable| Writable| Description | -| ------------------ | ------------------------------------------------- | ---- | ---- | ---------------------------------- | -| mainAbility | string | Yes| No| Name of the main ability.| -| apiVersion | [ApiVersion](#apiversion) | Yes | No | API version of the module. | -| deviceType | Array\ | Yes | No | Device types supported by the module. | -| distro | [ModuleDistroInfo](#moduledistroinfo) | Yes | No | Distribution information of the module. | -| abilities | Array\<[ModuleAbilityInfo](#moduleabilityinfo)> | Yes | No | Ability information of the module. | -| extensionAbilities | Array\<[ExtensionAbilities](#extensionability)> | Yes | No | ExtensionAbility information of the module.| - -## ModuleDistroInfo - -**System API**: This is a system API. - -**System capability**: SystemCapability.BundleManager.BundleFrameWork.FreeInstall - -| Name | Type | Readable| Writable| Description | -| ------------------- | ------- | ---- | ---- | ------------------------------------------------------------ | -| deliveryWithInstall | boolean | Yes | No | Whether the HAP file will be installed when the user installs the bundle. The value **true** means that the HAP file will be automatically installed when the user installs the bundle, and **false** means the opposite.| -| installationFree | boolean | Yes | No | Whether the HAP file supports the installation-free feature. The value **true** means that the HAP file supports the installation-free feature and meets installation-free constraints, and **false** means the opposite.| -| moduleName | string | Yes | No | Module name. | -| moduleType | string | Yes | No | Module type. | - -## ModuleAbilityInfo - -**System API**: This is a system API. - -**System capability**: SystemCapability.BundleManager.BundleFrameWork.FreeInstall - -| Name | Type | Readable| Writable| Description | -| ------- | ------------------------------------------- | ---- | ---- | ------------------------------------------------------------ | -| name | string | Yes | No | Name of the ability. The name must be unique in the bundle. | -| label | string | Yes | No | Name of the ability displayed to users. The value is a resource index to names in multiple languages.| -| visible | boolean | Yes | No | Whether the ability can be called by other bundles. The value **true** means that the ability can be called by other bundles, and **false** means the opposite.| -| forms | Array\<[AbilityFormInfo](#abilityforminfo)> | Yes | No | Widget information. | - -## ExtensionAbility - -**System API**: This is a system API. - -**System capability**: SystemCapability.BundleManager.BundleFrameWork.FreeInstall - -| Name | Type | Readable| Writable| Description | -| ----- | ------------------------------------------- | ---- | ---- | ------------------------------------------------------------ | -| name | string | Yes| No| Name of the ExtensionAbility.| -| forms | Array\<[AbilityFormInfo](#abilityforminfo)> | Yes | No | Widget information.| - -## AbilityFormInfo - -**System API**: This is a system API. - -**System capability**: SystemCapability.BundleManager.BundleFrameWork.FreeInstall - -| Name | Type | Readable| Writable| Description | -| ------------------- | -------------- | ---- | ---- | ------------------------------------------------------------ | -| name | string | Yes | No | Widget name. | -| type | string | Yes | No | Widget type. | -| updateEnabled | boolean | Yes | No | Whether the widget supports periodic update. The value **true** means that the widget supports periodic update, and **false** means the opposite.| -| scheduledUpdateTime | string | Yes | No | Scheduled time to update the widget. The value is in 24-hour format and accurate to the minute. | -| updateDuration | number | Yes | No | Interval to update the widget. The unit is 30 minutes. The value is a multiple of 30. A widget can be updated at a specified interval (**updateDuration**) or at the scheduled time (**scheduledUpdateTime**). If both are configured, **updateDuration** takes precedence.| -| supportDimensions | Array\ | Yes | No | Dimensions of the widget. The value can be **1\*2**, **2\*2**, **2\*4**, **4\*4**, or a combination of these options. At least one option must be specified when defining the widget.| -| defaultDimension | string | Yes | No | Default dimensions of the widget. The value must be available in the **supportDimensions** array of the widget.| - -## ApiVersion - -**System API**: This is a system API and cannot be called by third-party applications. - -**System capability**: SystemCapability.BundleManager.BundleFrameWork.FreeInstall - -| Name | Type | Readable| Writable| Description | -| ----------- | ------ | ---- | ---- | -------------------- | -| releaseType | string | Yes | No | Name of the API version. | -| compatible | number | Yes | No | Minimum API version.| -| target | number | Yes | No | Target API version. | - -## Version - -**System API**: This is a system API. - -**System capability**: SystemCapability.BundleManager.BundleFrameWork.FreeInstall - -| Name | Type | Readable| Writable| Description | -| ------------------------ | ------ | ---- | ---- | ------------------------------------------------------------ | -| minCompatibleVersionCode | number | Yes | No | Minimum compatible version of the bundle. It is used to check whether the bundle is compatible with a version on other devices in the cross-device scenario. The value is a 32-bit non-negative integer.| -| name | string | Yes | No | Version number of the bundle visible to users. | -| code | number | Yes | No | Version number of the bundle used only for bundle management. The value is a 32-bit non-negative integer. It is used only to determine whether a version is later than another version. A larger value indicates a later version.| diff --git a/en/application-dev/reference/apis/js-apis-data-ValuesBucket.md b/en/application-dev/reference/apis/js-apis-data-valuesBucket.md similarity index 100% rename from en/application-dev/reference/apis/js-apis-data-ValuesBucket.md rename to en/application-dev/reference/apis/js-apis-data-valuesBucket.md diff --git a/en/application-dev/reference/apis/js-apis-distributedBundle.md b/en/application-dev/reference/apis/js-apis-distributedBundle.md deleted file mode 100644 index 98a15d818444aac4bd9c57e0eb270c7a3c36fbe0..0000000000000000000000000000000000000000 --- a/en/application-dev/reference/apis/js-apis-distributedBundle.md +++ /dev/null @@ -1,479 +0,0 @@ -# distributedBundle - -The **distributedBundle** module provides APIs for managing distributed bundles. - -> **NOTE** -> -> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. -> -> The APIs provided by this module are system APIs. - -## Modules to Import - -``` -import distributedBundle from '@ohos.bundle.distributedBundle'; -``` - -## System Capability - -SystemCapability.BundleManager.DistributedBundleFramework - -## Required Permissions - -| Permission | Permission Level | Description | -| ------------------------------------------ | ------------ | ------------------ | -| ohos.permission.GET_BUNDLE_INFO_PRIVILEGED | system_basic | Permission to query information about all bundles.| - -For details, see [Permission Levels](../../security/accesstoken-overview.md#permission-levels). - -## distributedBundle.getRemoteAbilityInfo - -getRemoteAbilityInfo(elementName: ElementName, callback: AsyncCallback\): void; - -Obtains information about the remote ability that matches the given element name. This API uses an asynchronous callback to return the result. - -**System API**: This is a system API. - -**Required permissions**: ohos.permission.GET_BUNDLE_INFO_PRIVILEGED - -**System capability**: SystemCapability.BundleManager.DistributedBundleFramework - -**Parameters** - -| Name | Type | Mandatory| Description | -| ----------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | -| elementName | [ElementName](js-apis-bundleManager-elementName.md) | Yes | Target element name. | -| callback | AsyncCallback<[RemoteAbilityInfo](js-apis-bundleManager-remoteAbilityInfo.md)> | Yes | Callback used to return the result. If the operation is successful, **err** is **null** and **data** is the **RemoteAbilityInfo** object obtained. Otherwise, **err** is an error object.| - -**Error codes** - -For details about the error codes, see [Bundle Error Codes](../errorcodes/errorcode-bundle.md). - -| ID| Error Message | -|----------|--------------------------------------| -| 17700001 | The specified bundle name is not found. | -| 17700003 | The specified ability name is not found. | -| 17700007 | The specified device ID is not found. | -| 17700027 | The distributed service is not running. | - -**Example** - -```ts -try { - distributedBundle.getRemoteAbilityInfo( - { - deviceId: '1', - bundleName: 'com.example.application', - abilityName: 'MainAbility' - }, (err, data) => { - if (err) { - console.error('Operation failed:' + JSON.stringify(err)); - } else { - console.info('Operation succeed:' + JSON.stringify(data)); - } - }); -} catch (err) { - console.error('Operation failed:' + JSON.stringify(err)); -} -``` - -## distributedBundle.getRemoteAbilityInfo - -getRemoteAbilityInfo(elementName: ElementName): Promise\; - -Obtains information about the remote ability that matches the given element name. This API uses a promise to return the result. - -**System API**: This is a system API. - -**Required permissions**: ohos.permission.GET_BUNDLE_INFO_PRIVILEGED - -**System capability**: SystemCapability.BundleManager.DistributedBundleFramework - -**Parameters** - -| Name | Type | Mandatory| Description | -| ----------- | -------------------------------------------- | ---- | ----------------------- | -| elementName | [ElementName](js-apis-bundleManager-elementName.md) | Yes | Target element name.| - -**Return value** - -| Type | Description | -| ------------------------------------------------------------ | --------------------------------- | -| Promise\<[RemoteAbilityInfo](js-apis-bundleManager-remoteAbilityInfo.md)> | Promise used to return the **RemoteAbilityInfo** object obtained.| - -**Error codes** - -For details about the error codes, see [Bundle Error Codes](../errorcodes/errorcode-bundle.md). - -| ID| Error Message | -|----------|-------------------------| -| 17700001 | The specified bundle name is not found. | -| 17700003 | The specified ability name is not found. | -| 17700007 | The specified device ID is not found. | -| 17700027 | The distributed service is not running. | - -**Example** - -```ts -try { - distributedBundle.getRemoteAbilityInfo( - { - deviceId: '1', - bundleName: 'com.example.application', - abilityName: 'MainAbility' - }).then(data => { - console.info('Operation succeed:' + JSON.stringify(data)); - }).catch(err => { - console.error('Operation failed:' + JSON.stringify(err)); - }); -} catch (err) { - console.error('Operation failed:' + JSON.stringify(err)); -} -``` - -## distributedBundle.getRemoteAbilityInfo - -getRemoteAbilityInfo(elementNames: Array\, callback: AsyncCallback\>): void; - -Obtains information about remote abilities that match the given element names. This API uses an asynchronous callback to return the result. - -**System API**: This is a system API. - -**Required permissions**: ohos.permission.GET_BUNDLE_INFO_PRIVILEGED - -**System capability**: SystemCapability.BundleManager.DistributedBundleFramework - -**Parameters** - -| Name | Type | Mandatory| Description | -| ------------ | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | -| elementNames | Array<[ElementName](js-apis-bundleManager-elementName.md)> | Yes | **ElementName** array, whose maximum length is 10. | -| callback | AsyncCallback\> | Yes | Callback used to return the result. If the operation is successful, **err** is **null** and **data** is the array of **RemoteAbilityInfo** objects obtained. Otherwise, **err** is an error object.| - -**Error codes** - -For details about the error codes, see [Bundle Error Codes](../errorcodes/errorcode-bundle.md). - -| ID| Error Message | -|----------|-------------------------| -| 17700001 | The specified bundle name is not found. | -| 17700003 | The specified ability name is not found. | -| 17700007 | The specified device ID is not found. | -| 17700027 | The distributed service is not running. | - -**Example** - -```ts -try { - distributedBundle.getRemoteAbilityInfo( - [ - { - deviceId: '1', - bundleName: 'com.example.application1', - abilityName: 'MainAbility1' - }, - { - deviceId: '1', - bundleName: 'com.example.application2', - abilityName: 'MainAbility' - } - ], (err, data) => { - if (err) { - console.error('Operation failed:' + JSON.stringify(err)); - } else { - console.info('Operation succeed:' + JSON.stringify(data)); - } - }); -} catch (err) { - console.error('Operation failed:' + JSON.stringify(err)); -} -``` - -## distributedBundle.getRemoteAbilityInfo - -getRemoteAbilityInfo(elementNames: Array\): Promise\>; - -Obtains information about remote abilities that match the given element names and locales. This API uses a promise to return the result. - -**System API**: This is a system API. - -**Required permissions**: ohos.permission.GET_BUNDLE_INFO_PRIVILEGED - -**System capability**: SystemCapability.BundleManager.DistributedBundleFramework - -**Parameters** - -| Name | Type | Mandatory| Description | -| ------------ | --------------------------------------------------- | ---- | ----------------------- | -| elementNames | Array<[ElementName](js-apis-bundleManager-elementName.md)> | Yes | **ElementName** array, whose maximum length is 10.| - -**Return value** - -| Type | Description | -| ------------------------------------------------------------ | --------------------------------- | -| Promise\> | Promise used to return the array of **RemoteAbilityInfo** objects obtained.| - -**Error codes** - -For details about the error codes, see [Bundle Error Codes](../errorcodes/errorcode-bundle.md). - -| ID| Error Message | -|----------|-------------------------| -| 17700001 | The specified bundle name is not found. | -| 17700003 | The specified ability name is not found. | -| 17700007 | The specified device ID is not found. | -| 17700027 | The distributed service is not running. | - -**Example** - -```ts -try { - distributedBundle.getRemoteAbilityInfo( - [ - { - deviceId: '1', - bundleName: 'com.example.application', - abilityName: 'MainAbility' - }, - { - deviceId: '1', - bundleName: 'com.example.application2', - abilityName: 'MainAbility' - } - ]).then(data => { - console.info('Operation succeed:' + JSON.stringify(data)); - }).catch(err => { - console.error('Operation failed:' + JSON.stringify(err)); - }); -} catch (err) { - console.error('Operation failed:' + JSON.stringify(err)); -} -``` - -## distributedBundle.getRemoteAbilityInfo - -getRemoteAbilityInfo(elementName: ElementName, locale: string, callback: AsyncCallback\): void; - -Obtains information about the remote ability that matches the given element name and locale. This API uses an asynchronous callback to return the result. - -**System API**: This is a system API. - -**Required permissions**: ohos.permission.GET_BUNDLE_INFO_PRIVILEGED - -**System capability**: SystemCapability.BundleManager.DistributedBundleFramework - -**Parameters** - -| Name | Type | Mandatory| Description | -| ----------- | ------------------------------------------------------------ | ---- | -------------------------------------------------- | -| elementName | [ElementName](js-apis-bundleManager-elementName.md) | Yes | Target element name. | -| locale | string |Yes| Target locale.| -| callback | AsyncCallback<[RemoteAbilityInfo](js-apis-bundleManager-remoteAbilityInfo.md)> | Yes | Callback used to return the result. If the operation is successful, **err** is **null** and **data** is the **RemoteAbilityInfo** object obtained. Otherwise, **err** is an error object.| - -**Error codes** - -For details about the error codes, see [Bundle Error Codes](../errorcodes/errorcode-bundle.md). - -| ID| Error Message | -|----------|-------------------------| -| 17700001 | The specified bundle name is not found. | -| 17700003 | The specified ability name is not found. | -| 17700007 | The specified device ID is not found. | -| 17700027 | The distributed service is not running. | - -**Example** - -```ts -try { - distributedBundle.getRemoteAbilityInfo( - { - deviceId: '1', - bundleName: 'com.example.application', - abilityName: 'MainAbility' - }, 'zh-Hans-CN', (err, data) => { - if (err) { - console.error('Operation failed:' + JSON.stringify(err)); - } else { - console.info('Operation succeed:' + JSON.stringify(data)); - } - }); -} catch (err) { - console.error('Operation failed:' + JSON.stringify(err)); -} -``` - -## distributedBundle.getRemoteAbilityInfo - -getRemoteAbilityInfo(elementName: ElementName, locale: string): Promise\; - -Obtains information about the remote ability that matches the given element name and locale. This API uses a promise to return the result. - -**System API**: This is a system API. - -**Required permissions**: ohos.permission.GET_BUNDLE_INFO_PRIVILEGED - -**System capability**: SystemCapability.BundleManager.DistributedBundleFramework - -**Parameters** - -| Name | Type | Mandatory| Description | -| ----------- | -------------------------------------------- | ---- | ----------------------- | -| elementName | [ElementName](js-apis-bundleManager-elementName.md) | Yes | Target element name.| -| locale | string |Yes| Target locale.| - -**Return value** - -| Type | Description | -| ------------------------------------------------------------ | --------------------------------- | -| Promise\<[RemoteAbilityInfo](js-apis-bundleManager-remoteAbilityInfo.md)> | Promise used to return the **RemoteAbilityInfo** object obtained.| - -**Error codes** - -For details about the error codes, see [Bundle Error Codes](../errorcodes/errorcode-bundle.md). - -| ID| Error Message | -|----------|-------------------------| -| 17700001 | The specified bundle name is not found. | -| 17700003 | The specified ability name is not found. | -| 17700007 | The specified device ID is not found. | -| 17700027 | The distributed service is not running. | - -**Example** - -```ts -try { - distributedBundle.getRemoteAbilityInfo( - { - deviceId: '1', - bundleName: 'com.example.application', - abilityName: 'MainAbility' - }, 'zh-Hans-CN').then(data => { - console.info('Operation succeed:' + JSON.stringify(data)); - }).catch(err => { - console.error('Operation failed:' + JSON.stringify(err)); - }); -} catch (err) { - console.error('Operation failed:' + JSON.stringify(err)); -} -``` - -## distributedBundle.getRemoteAbilityInfo - -getRemoteAbilityInfo(elementNames: Array\, locale: string, callback: AsyncCallback\>): void; - -Obtains information about remote abilities that match the given element names and locales. This API uses an asynchronous callback to return the result. - -**System API**: This is a system API. - -**Required permissions**: ohos.permission.GET_BUNDLE_INFO_PRIVILEGED - -**System capability**: SystemCapability.BundleManager.DistributedBundleFramework - -**Parameters** - -| Name | Type | Mandatory| Description | -| ------------ | ------------------------------------------------------------ | ---- | -------------------------------------------------- | -| elementNames | Array<[ElementName](js-apis-bundleManager-elementName.md)> | Yes | **ElementName** array, whose maximum length is 10. | -| locale | string |Yes| Target locale.| -| callback | AsyncCallback\> | Yes | Callback used to return the result. If the operation is successful, **err** is **null** and **data** is the array of **RemoteAbilityInfo** objects obtained. Otherwise, **err** is an error object.| - -**Error codes** - -For details about the error codes, see [Bundle Error Codes](../errorcodes/errorcode-bundle.md). - -| ID | Error Message | -|---------------|-------------------------| -| 17700001 | The specified bundle name is not found. | -| 17700003 | The specified ability name is not found. | -| 17700007 | The specified device ID is not found. | -| 17700027 | The distributed service is not running. | - -**Example** - -```ts -try { - distributedBundle.getRemoteAbilityInfo( - [ - { - deviceId: '1', - bundleName: 'com.example.application1', - abilityName: 'MainAbility1' - }, - { - deviceId: '1', - bundleName: 'com.example.application2', - abilityName: 'MainAbility' - } - ], 'zh-Hans-CN', (err, data) => { - if (err) { - console.error('Operation failed:' + JSON.stringify(err)); - } else { - console.info('Operation succeed:' + JSON.stringify(data)); - } - }); -} catch (err) { - console.error('Operation failed:' + JSON.stringify(err)); -} -``` - -## distributedBundle.getRemoteAbilityInfo - -getRemoteAbilityInfo(elementNames: Array\, locale: string): Promise\>; - -Obtains information about remote abilities that match the given element names and locales. This API uses a promise to return the result. - -**System API**: This is a system API. - -**Required permissions**: ohos.permission.GET_BUNDLE_INFO_PRIVILEGED - -**System capability**: SystemCapability.BundleManager.DistributedBundleFramework - -**Parameters** - -| Name | Type | Mandatory| Description | -| ------------ | --------------------------------------------------- | ---- | ----------------------- | -| elementNames | Array<[ElementName](js-apis-bundleManager-elementName.md)> | Yes | **ElementName** array, whose maximum length is 10.| -| locale | string |Yes| Target locale.| - -**Return value** - -| Type | Description | -| ------------------------------------------------------------ | --------------------------------- | -| Promise\> | Promise used to return the array of **RemoteAbilityInfo** objects obtained.| - -**Error codes** - -For details about the error codes, see [Bundle Error Codes](../errorcodes/errorcode-bundle.md). - -| ID| Error Message | -|----------|-------------------------| -| 17700001 | The specified bundle name is not found. | -| 17700003 | The specified ability name is not found. | -| 17700007 | The specified device ID is not found. | -| 17700027 | The distributed service is not running. | - -**Example** - -```ts -try { - distributedBundle.getRemoteAbilityInfo( - [ - { - deviceId: '1', - bundleName: 'com.example.application', - abilityName: 'MainAbility' - }, - { - deviceId: '1', - bundleName: 'com.example.application2', - abilityName: 'MainAbility' - } - ], 'zh-Hans-CN').then(data => { - console.info('Operation succeed:' + JSON.stringify(data)); - }).catch(err => { - console.error('Operation failed:' + JSON.stringify(err)); - }); -} catch (err) { - console.error('Operation failed:' + JSON.stringify(err)); -} -``` diff --git a/en/application-dev/reference/apis/js-apis-inner-application-processRunningInformation.md b/en/application-dev/reference/apis/js-apis-inner-application-processInformation.md similarity index 57% rename from en/application-dev/reference/apis/js-apis-inner-application-processRunningInformation.md rename to en/application-dev/reference/apis/js-apis-inner-application-processInformation.md index a376446b2af90c8cc13f6eee80a10a5399dae041..2f247b72237230da9cc99988d5ea586e7bc4ed25 100644 --- a/en/application-dev/reference/apis/js-apis-inner-application-processRunningInformation.md +++ b/en/application-dev/reference/apis/js-apis-inner-application-processInformation.md @@ -1,6 +1,6 @@ -# ProcessRunningInformation +# ProcessInformation -The **ProcessRunningInformation** module defines the running information of a process. +The **ProcessInformation** module defines the running information of a process. > **NOTE** > @@ -8,13 +8,13 @@ The **ProcessRunningInformation** module defines the running information of a pr ## How to Use -The process running information is obtained through [getProcessRunningInformation](js-apis-application-appManager.md#appmanagergetprocessrunninginformation9) in **appManager**. +The process information is obtained by calling [getRunningProcessInformation](js-apis-app-ability-appManager.md#appmanagergetrunningprocessinformation9) of the **appManager** module. ```ts -import appManager from '@ohos.application.appManager'; +import appManager from '@ohos.app.ability.appManager'; -appManager.getProcessRunningInformation((error, data) => { - console.log("error: " + error.code + " data: " + JSON.stringify(data)); +appManager.getRunningProcessInformation((error, data) => { + console.log('error: ' + error.code + ' data: ' + JSON.stringify(data)); }); ``` diff --git a/en/application-dev/reference/apis/js-apis-inner-application-processRunningInfo.md b/en/application-dev/reference/apis/js-apis-inner-application-processRunningInfo.md index 0652791f728de12c144459146287ecbbb680480e..50f9418381bd6f837b83015f7729d9c2cc894c33 100644 --- a/en/application-dev/reference/apis/js-apis-inner-application-processRunningInfo.md +++ b/en/application-dev/reference/apis/js-apis-inner-application-processRunningInfo.md @@ -3,7 +3,7 @@ The **ProcessRunningInfo** module defines the running information of a process. > **NOTE** -> - The APIs provided by this module are deprecated since API version 9. You are advised to use [ProcessRunningInformation9+](js-apis-inner-application-processRunningInformation.md) instead. +> - The APIs provided by this module are deprecated since API version 9. You are advised to use [ProcessInformation9+](js-apis-inner-application-processInformation.md) instead. > - The initial APIs of this module are supported since API version 8. ## Attributes diff --git a/en/application-dev/reference/apis/js-apis-securityLabel.md b/en/application-dev/reference/apis/js-apis-securityLabel.md deleted file mode 100644 index d61e7c1b5a08c7dcdb841742a8359bac5e12ad69..0000000000000000000000000000000000000000 --- a/en/application-dev/reference/apis/js-apis-securityLabel.md +++ /dev/null @@ -1,179 +0,0 @@ -# Security Label - -The **secuityLabel** module provides APIs to manage file data security levels, including obtaining and setting file data security levels. - -> **NOTE**
-> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. - -## Modules to Import - -```js -import securityLabel from '@ohos.securityLabel'; -``` - -## Usage - -Before using the APIs provided by this module to perform operations on a file or directory, obtain the path of the application sandbox as follows: - -```js -import featureAbility from '@ohos.ability.featureAbility'; -let context = featureAbility.getContext(); -let path = ''; -context.getFilesDir().then((data) => { - path = data; -}) -``` - -## securityLabel.setSecurityLabel - -setSecurityLabel(path:string, type:dataLevel):Promise<void> - -Sets the security label for a file in asynchronous mode. This API uses a promise to return the result. - -**System capability**: SystemCapability.FileManagement.File.FileIO - -**Parameters** - -| Name | Type | Mandatory| Description | -| --------- | ------ | ---- | -------------------------------------------- | -| path | string | Yes | File path. | -| type | dataLevel | Yes | File security level, which can be **s0**, **s1**, **s2**, **s3**, or **s4**.| - -**Return value** - - | Type | Description | - | ------------------- | ---------------- | - | Promise<void> | Promise used to return the result. An empty value will be returned.| - -**Example** - - ```js - securityLabel.setSecurityLabel(path, "s0").then(function(){ - console.info("setSecurityLabel successfully"); - }).catch(function(error){ - console.info("setSecurityLabel failed with error:" + error); - }); - ``` - -## securityLabel.setSecurityLabel - -setSecurityLabel(path:string, type:dataLevel, callback: AsyncCallback<void>):void - -Sets the security label for a file in asynchronous mode. This API uses a callback to return the result. - -**System capability**: SystemCapability.FileManagement.File.FileIO - -**Parameters** - -| Name | Type | Mandatory| Description | -| --------- | ------------------------- | ---- | -------------------------------------------- | -| path | string | Yes | File path. | -| type | dataLevel | Yes | File security level, which can be **s0**, **s1**, **s2**, **s3**, or **s4**.| -| callback | AsyncCallback<void> | Yes | Callback used to return the result. | - -**Example** - - ```js - securityLabel.setSecurityLabel(path, "s0", function(error){ - console.info("setSecurityLabel:" + JSON.stringify(error)); - }); - ``` -## securityLabel.setSecurityLabelSync - -setSecurityLabelSync(path:string, type:dataLevel):void - -Sets the security label for a file in synchronous mode. - -**System capability**: SystemCapability.FileManagement.File.FileIO - -**Parameters** - -| Name | Type | Mandatory| Description | -| --------- | ------ | ---- | -------------------------------------------- | -| path | string | Yes | File path. | -| type | dataLevel | Yes | File security level, which can be **s0**, **s1**, **s2**, **s3**, or **s4**.| - -**Example** - -```js -securityLabel.setSecurityLabelSync(path, "s0"); -``` - -## securityLabel.getSecurityLabel - -getSecurityLabel(path:string):Promise<string> - -Obtains the security label of a file in asynchronous mode. This API uses a promise to return the result. - -**System capability**: SystemCapability.FileManagement.File.FileIO - -**Parameters** - - | Name| Type | Mandatory| Description | - | ------ | ------ | ---- | -------- | - | path | string | Yes | File path.| - -**Return value** - - | Type | Description | - | --------------------- | ------------ | - | Promise<string> | Promise used to return the security label obtained.| - -**Example** - - ```js - securityLabel.getSecurityLabel(path).then(function(type){ - console.log("getSecurityLabel successfully:" + type); - }).catch(function(err){ - console.log("getSecurityLabel failed with error:" + err); - }); - ``` - -## securityLabel.getSecurityLabel - -getSecurityLabel(path:string, callback:AsyncCallback<string>): void - -Obtains the security label of a file in asynchronous mode. This API uses a callback to return the result. - -**System capability**: SystemCapability.FileManagement.File.FileIO - -**Parameters** - - | Name | Type | Mandatory| Description | - | -------- | --------------------------- | ---- | -------------------------- | - | path | string | Yes | File path. | - | callback | AsyncCallback<string> | Yes | Callback used to return the security label obtained.| - -**Example** - - ```js - securityLabel.getSecurityLabel(path, function(err, type){ - console.log("getSecurityLabel successfully:" + type); - }); - ``` -## securityLabel.getSecurityLabelSync - -getSecurityLabelSync(path:string):string - -Obtains the security label of a file in synchronous mode. - -**System capability**: SystemCapability.FileManagement.File.FileIO - -**Parameters** - -| Name| Type | Mandatory| Description | -| ------ | ------ | ---- | -------- | -| path | string | Yes | File path.| - -**Return value** - -| Type | Description | -| ------ | ------------ | -| string | Security label obtained.| - -**Example** - -```js -let result = securityLabel.getSecurityLabelSync(path); -console.log("getSecurityLabel successfully:" + result); -``` diff --git a/en/application-dev/reference/apis/js-apis-storage-statistics.md b/en/application-dev/reference/apis/js-apis-storage-statistics.md deleted file mode 100644 index c54d9d4b01fec93df43f92f47eab8aaae951fb4e..0000000000000000000000000000000000000000 --- a/en/application-dev/reference/apis/js-apis-storage-statistics.md +++ /dev/null @@ -1,538 +0,0 @@ -# @ohos.storageStatistics (App Storage Statistics) - -The **storageStatistics** module provides APIs for obtaining storage space information, including the space of built-in and plug-in memory cards, space occupied by different types of data, and space of application data. - -> **NOTE** -> -> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version. - -## Modules to Import - -```js -import storageStatistics from "@ohos.storageStatistics"; -``` - -## storageStatistics.getTotalSizeOfVolume - -getTotalSizeOfVolume(volumeUuid: string): Promise<number> - -Asynchronously obtains the total size of the specified volume. This API uses a promise to return the result. - -**Required permissions**: ohos.permission.STORAGE_MANAGER - -**System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics - - -This is a system API and cannot be called by third-party applications. - - -**Parameters** - - | Name | Type | Mandatory| Description| - | ---------- | ------ | ---- | ---- | - | volumeUuid | string | Yes | UUID of the volume.| - -**Return value** - - | Type | Description | - | --------------------- | ---------------- | - | Promise<number> | Promise used to return the total size of the volume.| - -**Example** - - ```js - let uuid = ""; - storageStatistics.getTotalSizeOfVolume(uuid).then(function(number){ - console.info("getTotalSizeOfVolume successfully:"+ number); - }).catch(function(err){ - console.info("getTotalSizeOfVolume failed with error:"+ err); - }); - ``` - -## storageStatistics.getTotalSizeOfVolume - -getTotalSizeOfVolume(volumeUuid: string, callback: AsyncCallback<number>): void - -Asynchronously obtains the total size of the specified volume. This API uses a callback to return the result. - -**Required permissions**: ohos.permission.STORAGE_MANAGER - -**System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics - - -This is a system API and cannot be called by third-party applications. - - -**Parameters** - - | Name | Type | Mandatory| Description | - | ---------- | ------------------------------------ | ---- | -------------------------- | - | volumeUuid | string | Yes | UUID of the volume. | - | callback | callback: AsyncCallback<number> | Yes | Callback invoked to return the total size of the volume.| - -**Example** - - ```js - let uuid = ""; - storageStatistics.getTotalSizeOfVolume(uuid, function(error, number){ - // Do something. - console.info("getTotalSizeOfVolume successfully:"+ number); - }); - ``` - -## storageStatistics.getFreeSizeOfVolume - -getFreeSizeOfVolume(volumeUuid: string): Promise<number> - -Asynchronously obtains the available space of the specified volume. This API uses a promise to return the result. - -**Required permissions**: ohos.permission.STORAGE_MANAGER - -**System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics - - -This is a system API and cannot be called by third-party applications. - - -**Parameters** - - | Name | Type | Mandatory| Description| - | ---------- | ------ | ---- | ---- | - | volumeUuid | string | Yes | UUID of the volume.| - -**Return value** - - | Type | Description | - | --------------------- | ------------------ | - | Promise<number> | Promise used to return the available space of the volume.| - -**Example** - - ```js - let uuid = ""; - storageStatistics.getFreeSizeOfVolume(uuid).then(function(number){ - console.info("getFreeSizeOfVolume successfully:"+ number); - }).catch(function(err){ - console.info("getFreeSizeOfVolume failed with error:"+ err); - }); - - ``` - -## storageStatistics.getFreeSizeOfVolume - -getFreeSizeOfVolume(volumeUuid: string, callback: AsyncCallback<number>): void - -Asynchronously obtains the available space of the specified volume. This API uses a callback to return the result. - -**Required permissions**: ohos.permission.STORAGE_MANAGER - -**System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics - - -This is a system API and cannot be called by third-party applications. - - -**Parameters** - - | Name | Type | Mandatory| Description | - | ---------- | ------------------------------------ | ---- | ---------------------------- | - | volumeUuid | string | Yes | UUID of the volume. | - | callback | callback: AsyncCallback<number> | Yes | Callback invoked to return the available space of the volume.| - -**Example** - - ```js - let uuid = ""; - storageStatistics.getFreeSizeOfVolume(uuid, function(error, number){ - // Do something. - console.info("getFreeSizeOfVolume successfully:"+ number); - }); - ``` - -## storageStatistics.getBundleStats9+ - -getBundleStats(packageName: string): Promise<BundleStats> - -Asynchronously obtains space information of an application. This API uses a promise to return the result. - -**Required permissions**: ohos.permission.STORAGE_MANAGER - -**System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics - - -This is a system API and cannot be called by third-party applications. - - -**Parameters** - - | Name | Type | Mandatory| Description | - | ----------- | ------ | ---- | -------- | - | packageName | string | Yes | Bundle name of the application.| - -**Return value** - - | Type | Description | - | ------------------------------------------ | -------------------------- | - | Promise<[Bundlestats](#bundlestats)> | Promise used to return the space information obtained.| - -**Example** - - ```js - let packageName = ""; - storageStatistics.getBundleStats(packageName).then(function(BundleStats){ - console.info("getBundleStats successfully:"+ JSON.stringify(BundleStats)); - }).catch(function(err){ - console.info("getBundleStats failed with error:"+ err); - }); - ``` - -## storageStatistics.getBundleStats9+ - -getBundleStats(packageName: string, callback: AsyncCallback<BundleStats>): void - -Asynchronously obtains space information of an application. This API uses a callback to return the result. - -**Required permissions**: ohos.permission.STORAGE_MANAGER - -**System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics - - -This is a system API and cannot be called by third-party applications. - - -**Parameters** - - | Name | Type | Mandatory| Description | - | -------- | --------------------------------------------------------- | ---- | ------------------------------------ | - | packageName | string | Yes | Bundle name of the application.| - | callback | callback: AsyncCallback<[Bundlestats](#bundlestats)> | Yes | Callback invoked to return the space information obtained.| - -**Example** - - ```js - let packageName = ""; - storageStatistics.getBundleStats(packageName, function(error, BundleStats){ - // Do something. - console.info("getBundleStats successfully:"+ JSON.stringify(BundleStats)); - }); - ``` - -## storageStatistics.getCurrentBundleStats9+ - -getCurrentBundleStats(): Promise<BundleStats> - -Asynchronously obtains space information of the current third-party application. This API uses a promise to return the result. - -**System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics - -**Return value** - - | Type | Description | - | ------------------------------------------ | -------------------------- | - | Promise<[Bundlestats](#bundlestats)> | Promise used to return the space information obtained. | - -**Example** - - ```js - let bundleStats = storageStatistics.getCurrentBundleStats(); - console.info("getCurrentBundleStats successfully:"+ JSON.stringify(bundleStats)); - ``` - -## storageStatistics.getCurrentBundleStats9+ - -getCurrentBundleStats(callback: AsyncCallback<BundleStats>): void - -Asynchronously obtains space information of the current third-party application. This API uses a callback to return the result. - -**System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics - -**Parameters** - - | Name | Type | Mandatory | Description | - | -------- | --------------------------------------------------------- | ---- | ------------------------------------ | - | callback | callback: AsyncCallback<[BundleStats](#bundlestats)> | Yes | Callback invoked to return the space information obtained. | - -**Example** - - ```js - storageStatistics.getCurrentBundleStats(function(error, bundleStats){ - // Do something. - console.info("getCurrentBundleStats successfully:"+ JSON.stringify(bundleStats)); - }); - ``` - -## BundleStats9+ - -### Attributes - -**System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics - - -This is a system API and cannot be called by third-party applications. - -| Name | Type | Description | -| --------- | ------ | -------------- | -| appSize | number | Size of the application. | -| cacheSize | number | Cache size of the application. | -| dataSize | number | Total data size of the application.| - - -## storageStatistics.getTotalSize9+ - -getTotalSize(): Promise<number> - -Obtains the total space of the built-in memory card. This API uses a promise to return the result. - -**Required permissions**: ohos.permission.STORAGE_MANAGER - -**System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics - - -This is a system API and cannot be called by third-party applications. - - -**Return value** - - | Type | Description | - | --------------------- | ------------------ | - | Promise<number> | Promise used to return the total space of the built-in memory card. | - -**Example** - - ```js - let number = storageStatistics.getTotalSize(); - console.info("getTotalSize successfully:"+ JSON.stringify(number)); - ``` - -## storageStatistics.getTotalSize9+ - -getTotalSize(callback: AsyncCallback<number>): void - -Obtains the total space of the built-in memory card. This API uses a callback to return the result. - -**Required permissions**: ohos.permission.STORAGE_MANAGER - -**System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics - - -This is a system API and cannot be called by third-party applications. - - -**Parameters** - - | Name | Type | Mandatory | Description | - | -------- | ------------------------------------ | ---- | ------------------------ | - | callback | callback: AsyncCallback<number> | Yes | Callback invoked to return the total space of the built-in memory card.| - -**Example** - - ```js - storageStatistics.getTotalSize(function(error, number){ - // Do something. - console.info("getTotalSize successfully:"+ JSON.stringify(number)); - }); - ``` - - -## storageStatistics.getFreeSize9+ - -getFreeSize(): Promise<number> - -Obtains the available space of the built-in memory card. This API uses a promise to return the result. - -**Required permissions**: ohos.permission.STORAGE_MANAGER - -**System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics - - -This is a system API and cannot be called by third-party applications. - - -**Return value** - - | Type | Description | - | --------------------- | ------------------ | - | Promise<number> | Promise used to return the available space of the built-in memory card.| - -**Example** - - ```js - let number = storageStatistics.getFreeSize(); - console.info("getFreeSize successfully:"+ JSON.stringify(number)); - ``` - - -## storageStatistics.getFreeSize9+ - -getFreeSize(callback: AsyncCallback<number>): void - -Obtains the available space of the built-in memory card. This API uses a callback to return the result. - -**Required permissions**: ohos.permission.STORAGE_MANAGER - -**System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics - - -This is a system API and cannot be called by third-party applications. - - -**Parameters** - - | Name | Type | Mandatory| Description | - | -------- | ------------------------------------ | ---- | ------------------------- | - | callback | callback: AsyncCallback<number> | Yes | Callback invoked to return the available space of the built-in memory card.| - -**Example** - - ```js - storageStatistics.getFreeSize(function(error, number){ - // Do something. - console.info("getFreeSize successfully:"+ JSON.stringify(number)); - }); - ``` - -## storageStatistics.getSystemSize9+ - -getSystemSize(): Promise<number> - -Asynchronously obtains the system space. This API uses a promise to return the result. - -**Required permissions**: ohos.permission.STORAGE_MANAGER - -**System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics - - -This is a system API and cannot be called by third-party applications. - - -**Return value** - - | Type | Description | - | --------------------- | ---------------- | - | Promise<number> | Promise used to return the system space obtained.| - -**Example** - - ```js - storageStatistics.getSystemSize().then(function(number){ - console.info("getSystemSize successfully:"+ number); - }).catch(function(err){ - console.info("getSystemSize failed with error:"+ err); - }); - ``` - -## storageStatistics.getSystemSize9+ - -getSystemSize(callback: AsyncCallback<number>): void - -Asynchronously obtains the system space. This API uses a callback to return the result. - -**Required permissions**: ohos.permission.STORAGE_MANAGER - -**System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics - - -This is a system API and cannot be called by third-party applications. - - -**Parameters** - - | Name | Type | Mandatory| Description | - | ---------- | ------------------------------------ | ---- | -------------------------- | - | callback | callback: AsyncCallback<number> | Yes | Callback used to return the system space obtained.| - -**Example** - - ```js - storageStatistics.getSystemSize(function(error, number){ - // Do something. - console.info("getSystemSize successfully:"+ number); - }); - ``` - -## storageStatistics.getUserStorageStats9+ - -getUserStorageStats(userId? : number): Promise<StorageStats> - -Asynchronously obtains the space occupied by each type of user data. This API uses a promise to return the result. - -**Required permissions**: ohos.permission.STORAGE_MANAGER - -**System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics - - -This is a system API and cannot be called by third-party applications. - - -**Parameters** - - | Name | Type | Mandatory| Description| - | ---------- | ------ | ---- | ---- | - | userId | number | No | User ID.
Value:
-  Set this parameter to the ID of the user to be queried.
-  If no value is specified, information about the current user is queried.| - -**Return value** - - | Type | Description | - | --------------------- | ---------------- | - | Promise<[StorageStats](#storagestats)> | Promise used to return the information obtained.| - -**Example** - - ```js - let userId = 1; - storageStatistics.getUserStorageStats(userId).then(function(StorageStats){ - console.info("getUserStorageStats successfully:"+ JSON.stringify(StorageStats)); - }).catch(function(err){ - console.info("getUserStorageStats failed with error:"+ err); - }); - ``` - -## storageStatistics.getUserStorageStats9+ - -getUserStorageStats(userId: number, callback: AsyncCallback<StorageStats>): void - -Asynchronously obtains the space occupied by each type of user data. This API uses a callback to return the result. - -**Required permissions**: ohos.permission.STORAGE_MANAGER - -**System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics - - -This is a system API and cannot be called by third-party applications. - - -**Parameters** - - | Name | Type | Mandatory| Description | - | ---------- | ------------------------------------ | ---- | -------------------------- | - | userId | number | No | User ID.
Value:
-  Set this parameter to the ID of the user to be queried.
-  If no value is specified, information about the current user is queried. | - | callback | callback: AsyncCallback<[StorageStats](#storagestats)> | Yes | Callback invoked to return the information obtained.| - -**Example** - - ```js - let userId = 1; - storageStatistics.getUserStorageStats(userId, function(error, StorageStats){ - // Do something. - console.info("getUserStorageStats successfully:"+ JSON.stringify(StorageStats)); - }); - ``` - - -## StorageStats9+ - -### Attributes - -**System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics - - -This is a system API and cannot be called by third-party applications. - -| Name | Type | Description | -| --------- | ------ | -------------- | -| total | number | Total space of the built-in memory card. | -| audio | number | Space occupied by audio data. | -| video | number | Space occupied by video data.| -| image | number | Space occupied by image data. | -| file | number | Space occupied by files. | -| app | number | Space occupied by application data.| diff --git a/en/application-dev/reference/apis/js-apis-volumemanager.md b/en/application-dev/reference/apis/js-apis-volumemanager.md deleted file mode 100644 index 79cbf5db12746acc8e18d293c03fe3aa48bdc86a..0000000000000000000000000000000000000000 --- a/en/application-dev/reference/apis/js-apis-volumemanager.md +++ /dev/null @@ -1,502 +0,0 @@ -# Volume Management - -The volumeManager module provides APIs for volume and disk management, including obtaining volume information, mounting or unmounting volumes, partitioning disks, and formatting volumes. - -> **NOTE**
-> -> - The initial APIs of this module are supported since API version 9. -> - API version 9 is a canary version for trial use. The APIs of this version may be unstable. -> - The APIs of this module are system APIs and cannot be called by third-party applications. - -## Modules to Import - -```js -import volumemanager from "@ohos.volumeManager"; -``` - -## volumemanager.getAllVolumes - -getAllVolumes(): Promise<Array<Volume>> - -Asynchronously obtains information about all available volumes. This API uses a promise to return the result. - -**Required permissions**: ohos.permission.STORAGE_MANAGER - -**System capability**: SystemCapability.FileManagement.StorageService.Volume - -**Return value** - - | Type | Description | - | ---------------------------------- | -------------------------- | - | Promise<[Volume](#volume)[]> | Promise used to return the execution result.| - -**Example** - - ```js - volumemanager.getAllVolumes().then(function(volumes){ - // Do something. - }); - ``` - -## volumemanager.getAllVolumes - -getAllVolumes(callback: AsyncCallback<Array<Volume>>): void - -Asynchronously obtains information about all available volumes. This API uses a callback to return the result. - -**Required permissions**: ohos.permission.STORAGE_MANAGER - -**System capability**: SystemCapability.FileManagement.StorageService.Volume - -**Parameters** - - | Name | Type | Mandatory| Description | - | -------- | ------------------------------------------------- | ---- | ------------------------------------ | - | callback | callback: AsyncCallback<[Volume](#volume)[]> | Yes | Callback invoked to return the volume information obtained.| - -**Example** - - ```js - let uuid = ""; - volumemanager.getAllVolumes(function(error, volumes){ - // Do something - }); - ``` - - -## volumemanager.mount - -mount(volumeId: string): Promise<boolean> - -Asynchronously mounts a volume. This API uses a promise to return the result. - -**Required permissions**: ohos.permission.MOUNT_UNMOUNT_MANAGER - -**System capability**: SystemCapability.FileManagement.StorageService.Volume - -**Parameters** - - | Name | Type | Mandatory| Description| - | -------- | ------ | ---- | ---- | - | volumeId | string | Yes | Volume ID.| - -**Return value** - - | Type | Description | - | ---------------------- | ---------- | - | Promise<boolean> | Promise used to return the execution result.| - -**Example** - - ```js - let volumeId = ""; - volumemanager.mount(volumeId).then(function(flag){ - // Do something - }); - ``` - -## volumemanager.mount - -mount(volumeId: string, callback:AsyncCallback<boolean>):void - -Asynchronously obtains the available space of the specified volume. This API uses a callback to return the result. - -**Required permissions**: ohos.permission.MOUNT_UNMOUNT_MANAGER - -**System capability**: SystemCapability.FileManagement.StorageService.Volume - -**Parameters** - - | Name | Type | Mandatory| Description | - | -------- | ------------------------------------- | ---- | -------------------- | - | volumeId | string | Yes | Volume ID. | - | callback | callback: AsyncCallback<boolean> | Yes | Callback invoked to return the execution result.| - -**Example** - - ```js - let volumeId = ""; - volumemanager.mount(volumeId, function(error, flag){ - // Do something - }); - ``` - -## volumemanager.unmount - -unmount(volumeId: string): Promise<boolean> - -Asynchronously unmounts a volume. This API uses a promise to return the result. - -**Required permissions**: ohos.permission.MOUNT_UNMOUNT_MANAGER - -**System capability**: SystemCapability.FileManagement.StorageService.Volume - -**Parameters** - - | Name | Type | Mandatory| Description| - | -------- | ------ | ---- | ---- | - | volumeId | string | Yes | Volume ID.| - -**Return value** - - | Type | Description | - | ---------------------- | ---------- | - | Promise<boolean> | Promise used to return the execution result.| - -**Example** - - ```js - let volumeId = ""; - volumemanager.unmount(volumeId).then(function(flag){ - // Do something - }); - ``` - -## volumemanager.unmount - -unmount(volumeId: string, callback: AsyncCallback<boolean>): void - -Asynchronously unmounts a volume. This API uses a callback to return the result. - -**Required permissions**: ohos.permission.MOUNT_UNMOUNT_MANAGER - -**System capability**: SystemCapability.FileManagement.StorageService.Volume - -**Parameters** - - | Name | Type | Mandatory| Description | - | -------- | ------------------------------------- | ---- | -------------------- | - | volumeId | string | Yes | Volume ID. | - | callback | callback: AsyncCallback<boolean> | Yes | Callback invoked to return the execution result.| - -**Example** - - ```js - let volumeId = ""; - volumemanager.unmount(volumeId, function(error, flag){ - // Do something - }); - ``` - -## volumemanager.getVolumeByUuid - -getVolumeByUuid(uuid: string): Promise<Volume> - -Asynchronously obtains volume information based on the universally unique identifier (UUID). This API uses a promise to return the result. - -**Required permissions**: ohos.permission.STORAGE_MANAGER - -**System capability**: SystemCapability.FileManagement.StorageService.Volume - -**Parameters** - - | Name | Type | Mandatory| Description| - | -------- | ------ | ---- | ---- | - | uuid | string | Yes | UUID of the volume.| - -**Return value** - - | Type | Description | - | ---------------------------------- | -------------------------- | - | Promise<[Volume](#volume)> | Promise used to return the volume information obtained.| - -**Example** - - ```js - let uuid = ""; - volumemanager.getVolumeByUuid(uuid).then(function(volume) { - console.info("getVolumeByUuid successfully:" + JSON.stringify(volume)); - }).catch(function(error){ - console.info("getVolumeByUuid failed with error:"+ error); - }); - ``` - -## volumemanager.getVolumeByUuid - -getVolumeByUuid(uuid: string, callback: AsyncCallback<Volume>): void - -Asynchronously obtains volume information based on the UUID. This API uses a callback to return the result. - -**Required permissions**: ohos.permission.STORAGE_MANAGER - -**System capability**: SystemCapability.FileManagement.StorageService.Volume - -**Parameters** - - | Name | Type | Mandatory| Description | - | -------- | ------------------------------------------------ | ---- | -------------------- | - | uuid | string | Yes | UUID of the volume. | - | callback | callback: AsyncCallback<[Volume](#volume)> | Yes | Callback invoked to return the volume information obtained.| - -**Example** - - ```js - let uuid = ""; - volumemanager.getVolumeByUuid(uuid, (error, volume) => { - // Do something. - }); - ``` - -## volumemanager.getVolumeById - -getVolumeById(volumeId: string): Promise<Volume> - -Asynchronously obtains volume information based on the volume ID. This API uses a promise to return the result. - -**Required permissions**: ohos.permission.STORAGE_MANAGER - -**System capability**: SystemCapability.FileManagement.StorageService.Volume - -**Parameters** - - | Name | Type | Mandatory | Description| - | -------- | ------ | ---- | ---- | - | volumeId | string | Yes | Volume ID.| - -**Return value** - - | Type | Description | - | ---------------------------------- | -------------------------- | - | Promise<[Volume](#volume)> | Promise used to return the volume information obtained.| - -**Example** - - ```js - let volumeId = ""; - volumemanager.getVolumeById(volumeId).then(function(volume) { - console.info("getVolumeById successfully:" + JSON.stringify(volume)); - }).catch(function(error){ - console.info("getVolumeById failed with error:"+ error); - }); - ``` - -## volumemanager.getVolumeById - -getVolumeById(volumeId: string, callback: AsyncCallback<Volume>): void - -Asynchronously obtains volume information based on the volume ID. This API uses a callback to return the result. - -**Required permissions**: ohos.permission.STORAGE_MANAGER - -**System capability**: SystemCapability.FileManagement.StorageService.Volume - -**Parameters** - - | Name | Type | Mandatory| Description | - | -------- | ------------------------- | ---- | ----------------------------- | - | volumeId | string | Yes | Volume ID. | - | callback | callback:AsyncCallback<[Volume](#volume)> | Yes | Callback invoked to return the volume information obtained. | - -**Example** - - ```js - let volumeId = ""; - volumemanager.getVolumeById(volumeId, (error, volume) => { - // Do something. - }); - ``` - -## volumemanager.setVolumeDescription - -setVolumeDescription(uuid: string, description: string): Promise<void> - -Asynchronously sets the volume description based on the UUID. This API uses a promise to return the result. - -**Required permissions**: ohos.permission.MOUNT_UNMOUNT_MANAGER - -**System capability**: SystemCapability.FileManagement.StorageService.Volume - -**Parameters** - - | Name | Type | Mandatory| Description| - | --------- | ------ | ---- | ---- | - | uuid | string | Yes | UUID of the volume.| - | description | string | Yes | Volume description.| - -**Return value** - - | Type | Description | - | ---------------------- | -------------------------- | - | Promise<void> | Promise used to return the result. | - -**Example** - - ```js - let uuid = ""; - let description = ""; - volumemanager.setVolumeDescription(uuid, description).then(function() { - console.info("setVolumeDescription successfully"); - }).catch(function(error){ - console.info("setVolumeDescription failed with error:"+ error); - }); - ``` - -## volumemanager.setVolumeDescription - -setVolumeDescription(uuid: string, description: string, callback: AsyncCallback<void>): void - -Asynchronously sets the volume description based on the UUID. This API uses a callback to return the result. - -**Required permissions**: ohos.permission.MOUNT_UNMOUNT_MANAGER - -**System capability**: SystemCapability.FileManagement.StorageService.Volume - -**Parameters** - - | Name | Type | Mandatory| Description | - | ---------- | --------------------------------------- | ---- | ---------------- | - | uuid | string | Yes | UUID of the volume. | - | description | string | Yes | Volume description. | - | callback | callback: AsyncCallback<void> | Yes | Callback invoked to return the result.| - -**Example** - - ```js - let uuid = ""; - let description = ""; - volumemanager.setVolumeDescription(uuid, description, (error, bool) => { - // Do something. - }); - ``` - -## volumemanager.format - -format(volumeId: string, fsType: string): Promise<void> - -Asynchronously formats a volume. This API uses a promise to return the result. - -**Required permissions**: ohos.permission.MOUNT_FORMAT_MANAGER - -**System capability**: SystemCapability.FileManagement.StorageService.Volume - -**Parameters** - - | Name | Type | Mandatory| Description| - | ----------- | ------ | ---- | ---- | - | volumeId | string | Yes | Volume ID.| - | fsType | string | Yes | File system type.| - -**Return value** - - | Type | Description | - | ---------------------- | ---------- | - | Promise<void> | Promise used to return the result.| - -**Example** - - ```js - let volumeId = ""; - let fsType = ""; - volumemanager.format(volumeId, fsType).then(function() { - console.info("format successfully"); - }).catch(function(error){ - console.info("format failed with error:"+ error); - }); - ``` - -## volumemanager.format - -format(volumeId: string, fsType: string, callback: AsyncCallback<void>): void - -Asynchronously formats a volume. This API uses a callback to return the result. - -**Required permissions**: ohos.permission.MOUNT_FORMAT_MANAGER - -**System capability**: SystemCapability.FileManagement.StorageService.Volume - -**Parameters** - - | Name | Type | Mandatory| Description | - | -------- | ------------------------- | ---- | ----------------------------- | - | volumeId | string | Yes | Volume ID. | - | fsType | string | Yes | File system type.| - | callback | callback: AsyncCallback<void> | Yes | Called after the volume is formatted. | - -**Example** - - ```js - let volumeId = ""; - let fsType = ""; - volumemanager.format(volumeId, fsType, (error, bool) => { - // Do something. - }); - ``` - -## volumemanager.partition - -partition(diskId: string, type: number): Promise<void> - -Asynchronously partitions a disk. This API uses a promise to return the result. - -**Required permissions**: ohos.permission.MOUNT_FORMAT_MANAGER - -**System capability**: SystemCapability.FileManagement.StorageService.Volume - -**Parameters** - - | Name | Type | Mandatory| Description| - | ----------- | ------ | ---- | ---- | - | diskId | string | Yes | ID of the disk to which the volume belongs.| - | type | number | Yes | Partition type. | - -**Return value** - - | Type | Description | - | --------------------- | ----------------------- | - | Promise<void> | Promise used to return the result. | - -**Example** - - ```js - let diskId = ""; - let type = 0; - volumemanager.partition(diskId, type).then(function() { - console.info("partition successfully"); - }).catch(function(error){ - console.info("partition failed with error:"+ error); - }); - ``` - -## volumemanager.partition - -partition(diskId: string, type: number, callback: AsyncCallback<void>): void - -Asynchronously partitions a disk. This API uses a callback to return the result. - -**Required permissions**: ohos.permission.MOUNT_FORMAT_MANAGER - -**System capability**: SystemCapability.FileManagement.StorageService.Volume - -**Parameters** - - | Name | Type | Mandatory| Description | - | -------- | --------------------------------------- | ---- | ---------------- | - | diskId | string | Yes | ID of the disk to which the volume belongs. | - | type | number | Yes | Partition type. | - | callback | callback: AsyncCallback<void> | Yes | Callback invoked to return the result. | - -**Example** - - ```js - let diskId = ""; - let type = 0; - volumemanager.partition(diskId, type, (error, bool) => { - // Do something. - }); - ``` - -## Volume - -**System capability**: SystemCapability.FileManagement.StorageService.Volume - -### Attributes - -| Name | Type | Description | -| ----------- | ------- | -------------------- | -| id | string | Volume ID. | -| uuid | string | UUID of the volume. | -| diskId | string | ID of the disk to which the volume belongs. | -| description | string | Description of the volume. | -| removable | boolean | Whether the volume is a removable storage device.| -| state | number | Volume state. | -| path | string | Mount address of the volume. | diff --git a/en/application-dev/reference/errorcodes/Readme-EN.md b/en/application-dev/reference/errorcodes/Readme-EN.md index c2ade1369554bcbc167d932b16340d48e005098f..fabe9ee1204c0e78b50c7cbf5dab62581a2a9f4d 100644 --- a/en/application-dev/reference/errorcodes/Readme-EN.md +++ b/en/application-dev/reference/errorcodes/Readme-EN.md @@ -26,7 +26,7 @@ - Resource Management - [I18N Error Codes](errorcode-i18n.md) - [Resource Manager Error Codes](errorcode-resource-manager.md) -- Resource Scheduling +- Background Tasks - [backgroundTaskManager Error Codes](errorcode-backgroundTaskMgr.md) - [reminderAgentManager Error Codes](errorcode-reminderAgentManager.md) - [workScheduler Error Codes](errorcode-workScheduler.md) @@ -79,7 +79,7 @@ - [DeviceUsageStatistics Error Codes](errorcode-DeviceUsageStatistics.md) - Customization Management - [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) -- Language Base Class Library +- Utils - [Utils Error Codes](errorcode-utils.md) - Test - [UiTest Error Codes](errorcode-uitest.md) diff --git a/en/application-dev/security/Readme-EN.md b/en/application-dev/security/Readme-EN.md index 05d2d2864de5dc34947f43d1b54ab2480e039747..6fea6fa455967d752e470a43907d11e2ebe3c4cb 100644 --- a/en/application-dev/security/Readme-EN.md +++ b/en/application-dev/security/Readme-EN.md @@ -3,8 +3,8 @@ - Access Control - [Access Control (Permission) Overview](accesstoken-overview.md) - [Permission Application Guide](accesstoken-guidelines.md) - - [Permission Verification Guide](permission-verify-guidelines.md) - - [App Permission List](permission-list.md) + - [API Access Permission Verification](permission-verify-guidelines.md) + - [Application Permission List](permission-list.md) - User Authentication - [User Authentication Overview](userauth-overview.md) - [User Authentication Development](userauth-guidelines.md) @@ -17,7 +17,7 @@ - Certificate - [Certificate Overview](cert-overview.md) - [Certificate Development](cert-guidelines.md) -- hapsigner +- hapsigner - [hapsigner Overview](hapsigntool-overview.md) - [hapsigner Guide](hapsigntool-guidelines.md) - [HarmonyAppProvision Configuration File](app-provision-structure.md) \ No newline at end of file