提交 b52f9d73 编写于 作者: G Gloria

Update docs against 20989

Signed-off-by: wusongqing<wusongqing@huawei.com>
上级 c88b278c
...@@ -15,11 +15,10 @@ import bundle from '@ohos.bundle'; ...@@ -15,11 +15,10 @@ import bundle from '@ohos.bundle';
| Required Permissions | Permission Level | Description | | Required Permissions | Permission Level | Description |
|--------------------------------------------|--------------|---------------| |--------------------------------------------|--------------|---------------|
| ohos.permission.CHANGE_ABILITY_ENABLED_STATE | system_basic | Permission to enable or disable an application or ability.| | ohos.permission.GET_BUNDLE_INFO | normal | Permission to query information about a specified bundle. |
| ohos.permission.GET_BUNDLE_INFO | normal | Permission to query information about a specified bundle.|
| ohos.permission.GET_BUNDLE_INFO_PRIVILEGED| system_basic | Permission to query information about all bundles. | | ohos.permission.GET_BUNDLE_INFO_PRIVILEGED| system_basic | Permission to query information about all bundles. |
| ohos.permission.INSTALL_BUNDLE | system_core | Permission to install or uninstall bundles. | | ohos.permission.INSTALL_BUNDLE | system_core | Permission to install or uninstall bundles. |
| ohos.permission.REMOVE_CACHE_FILES | system_basic | Permission to clear cache files of a bundle.| | ohos.permission.MANAGE_DISPOSED_APP_STATUS | system_core | Permission to set and query the application disposal status.|
For details, see [Permission Levels](../../security/accesstoken-overview.md#permission-levels). For details, see [Permission Levels](../../security/accesstoken-overview.md#permission-levels).
...@@ -45,7 +44,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -45,7 +44,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ----------- | ------ | ---- | ------------------------------------------------------------ | | ----------- | ------ | ---- | ------------------------------------------------------------ |
| bundleName | string | Yes | Bundle name. | | bundleName | string | Yes | Bundle name of the application. |
| bundleFlags | number | Yes | Type of information that will be returned. For details about the available enumerated values, see the application information flags in [BundleFlag](#bundleflagdeprecated).| | bundleFlags | number | Yes | Type of information that will be returned. For details about the available enumerated values, see the application information flags in [BundleFlag](#bundleflagdeprecated).|
| userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. | | userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. |
...@@ -91,7 +90,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -91,7 +90,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ----------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | ----------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| bundleName | string | Yes | Bundle name. | | bundleName | string | Yes | Bundle name of the application. |
| bundleFlags | number | Yes | Type of information that will be returned. For details about the available enumerated values, see the application information flags in [BundleFlag](#bundleflagdeprecated).| | bundleFlags | number | Yes | Type of information that will be returned. For details about the available enumerated values, see the application information flags in [BundleFlag](#bundleflagdeprecated).|
| userId | number | Yes | User ID. The value must be greater than or equal to 0. | | userId | number | Yes | User ID. The value must be greater than or equal to 0. |
| callback | AsyncCallback\<[ApplicationInfo](js-apis-bundle-ApplicationInfo.md)> | Yes | Callback used to return the application information. | | callback | AsyncCallback\<[ApplicationInfo](js-apis-bundle-ApplicationInfo.md)> | Yes | Callback used to return the application information. |
...@@ -134,7 +133,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -134,7 +133,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ----------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | ----------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| bundleName | string | Yes | Bundle name. | | bundleName | string | Yes | Bundle name of the application. |
| bundleFlags | number | Yes | Type of information that will be returned. For details about the available enumerated values, see the application information flags in [BundleFlag](#bundleflagdeprecated).| | bundleFlags | number | Yes | Type of information that will be returned. For details about the available enumerated values, see the application information flags in [BundleFlag](#bundleflagdeprecated).|
| callback | AsyncCallback\<[ApplicationInfo](js-apis-bundle-ApplicationInfo.md)> | Yes | Callback used to return the application information. | | callback | AsyncCallback\<[ApplicationInfo](js-apis-bundle-ApplicationInfo.md)> | Yes | Callback used to return the application information. |
...@@ -187,7 +186,6 @@ SystemCapability.BundleManager.BundleFramework ...@@ -187,7 +186,6 @@ SystemCapability.BundleManager.BundleFramework
```ts ```ts
let bundleFlag = 0; let bundleFlag = 0;
let userId = 100; let userId = 100;
bundle.getAllBundleInfo(bundleFlag, userId) bundle.getAllBundleInfo(bundleFlag, userId)
.then((data) => { .then((data) => {
console.info('Operation successful. Data: ' + JSON.stringify(data)); console.info('Operation successful. Data: ' + JSON.stringify(data));
...@@ -296,7 +294,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -296,7 +294,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ----------- | ------------- | ---- |---------------------------------------------------------------------| | ----------- | ------------- | ---- |---------------------------------------------------------------------|
| bundleName | string | Yes | Bundle name. | | bundleName | string | Yes | Bundle name of the application. |
| bundleFlags | number | Yes | Type of information that will be returned. For details about the available enumerated values, see the bundle information flags in [BundleFlag](#bundleflagdeprecated).| | bundleFlags | number | Yes | Type of information that will be returned. For details about the available enumerated values, see the bundle information flags in [BundleFlag](#bundleflagdeprecated).|
| options | [BundleOptions](#bundleoptionsdeprecated) | No | Options that contain the user ID. | | options | [BundleOptions](#bundleoptionsdeprecated) | No | Options that contain the user ID. |
...@@ -312,7 +310,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -312,7 +310,7 @@ SystemCapability.BundleManager.BundleFramework
let bundleName = "com.example.myapplication"; let bundleName = "com.example.myapplication";
let bundleFlags = 1; let bundleFlags = 1;
let options = { let options = {
"userId": 100 "userId" : 100
}; };
bundle.getBundleInfo(bundleName, bundleFlags, options) bundle.getBundleInfo(bundleName, bundleFlags, options)
.then((data) => { .then((data) => {
...@@ -343,8 +341,8 @@ SystemCapability.BundleManager.BundleFramework ...@@ -343,8 +341,8 @@ SystemCapability.BundleManager.BundleFramework
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ----------- | ---------------------------------------------------------- | ---- | ------------------------------------------------------------ | | ----------- | ---------------------------------------------------------- | ---- |---------------------------------------------------------------------|
| bundleName | string | Yes | Bundle name. | | bundleName | string | Yes | Bundle name of the application. |
| bundleFlags | number | Yes | Type of information that will be returned. For details about the available enumerated values, see the bundle information flags in [BundleFlag](#bundleflagdeprecated).| | bundleFlags | number | Yes | Type of information that will be returned. For details about the available enumerated values, see the bundle information flags in [BundleFlag](#bundleflagdeprecated).|
| callback | AsyncCallback\<[BundleInfo](js-apis-bundle-BundleInfo.md)> | Yes | Callback used to return the bundle information. | | callback | AsyncCallback\<[BundleInfo](js-apis-bundle-BundleInfo.md)> | Yes | Callback used to return the bundle information. |
...@@ -362,13 +360,14 @@ bundle.getBundleInfo(bundleName, bundleFlags, (err, data) => { ...@@ -362,13 +360,14 @@ bundle.getBundleInfo(bundleName, bundleFlags, (err, data) => {
}) })
``` ```
## bundle.getBundleInfo<sup>deprecated<sup> ## bundle.getBundleInfo<sup>deprecated<sup>
> This API is deprecated since API version 9. You are advised to use [bundleManager.getBundleInfo](js-apis-bundleManager.md#bundlemanagergetbundleinfo) instead. > This API is deprecated since API version 9. You are advised to use [bundleManager.getBundleInfo](js-apis-bundleManager.md#bundlemanagergetbundleinfo) instead.
getBundleInfo(bundleName: string, bundleFlags: number, options: BundleOptions, callback: AsyncCallback\<BundleInfo>): void getBundleInfo(bundleName: string, bundleFlags: number, options: BundleOptions, callback: AsyncCallback\<BundleInfo>): void
Obtains the bundle information based on a given bundle name and bundle options. This API uses an asynchronous callback to return the result. Obtains the bundle information based on a given bundle name. This API uses an asynchronous callback to return the result.
No permission is required for obtaining the caller's own information. No permission is required for obtaining the caller's own information.
...@@ -384,7 +383,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -384,7 +383,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ----------- | ---------------------------------------------------------- | ---- | ------------------------------------------------------------ | | ----------- | ---------------------------------------------------------- | ---- | ------------------------------------------------------------ |
| bundleName | string | Yes | Bundle name. | | bundleName | string | Yes | Bundle name of the application. |
| bundleFlags | number | Yes | Type of information that will be returned. For details about the available enumerated values, see the bundle information flags in [BundleFlag](#bundleflagdeprecated).| | bundleFlags | number | Yes | Type of information that will be returned. For details about the available enumerated values, see the bundle information flags in [BundleFlag](#bundleflagdeprecated).|
| options | [BundleOptions](#bundleoptionsdeprecated) | Yes | Includes **userId**. | | options | [BundleOptions](#bundleoptionsdeprecated) | Yes | Includes **userId**. |
| callback | AsyncCallback\<[BundleInfo](js-apis-bundle-BundleInfo.md)> | Yes | Callback used to return the bundle information. | | callback | AsyncCallback\<[BundleInfo](js-apis-bundle-BundleInfo.md)> | Yes | Callback used to return the bundle information. |
...@@ -395,7 +394,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -395,7 +394,7 @@ SystemCapability.BundleManager.BundleFramework
let bundleName = "com.example.myapplication"; let bundleName = "com.example.myapplication";
let bundleFlags = 1; let bundleFlags = 1;
let options = { let options = {
"userId": 100 "userId" : 100
}; };
bundle.getBundleInfo(bundleName, bundleFlags, options, (err, data) => { bundle.getBundleInfo(bundleName, bundleFlags, options, (err, data) => {
if (err) { if (err) {
...@@ -426,7 +425,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -426,7 +425,7 @@ SystemCapability.BundleManager.BundleFramework
**System API** **System API**
This is a system API. This is a system API and cannot be called by third-party applications.
**Return value** **Return value**
...@@ -462,7 +461,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -462,7 +461,7 @@ SystemCapability.BundleManager.BundleFramework
**System API** **System API**
This is a system API. This is a system API and cannot be called by third-party applications.
**Parameters** **Parameters**
...@@ -499,13 +498,13 @@ SystemCapability.BundleManager.BundleFramework ...@@ -499,13 +498,13 @@ SystemCapability.BundleManager.BundleFramework
**System API** **System API**
This is a system API. This is a system API and cannot be called by third-party applications.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ---------- | ------------------- | ---- | ------------------------------------- | | ---------- | ------------------- | ---- | ------------------------------------- |
| bundleName | string | Yes | Bundle name.| | bundleName | string | Yes | Bundle name of the application.|
| callback | AsyncCallback\<void> | Yes | Callback used to return the result. | | callback | AsyncCallback\<void> | Yes | Callback used to return the result. |
**Example** **Example**
...@@ -540,13 +539,13 @@ SystemCapability.BundleManager.BundleFramework ...@@ -540,13 +539,13 @@ SystemCapability.BundleManager.BundleFramework
**System API** **System API**
This is a system API. This is a system API and cannot be called by third-party applications.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ---------- | ------ | ---- | ------------------------------------- | | ---------- | ------ | ---- | ------------------------------------- |
| bundleName | string | Yes | Bundle name.| | bundleName | string | Yes | Bundle name of the application.|
**Return value** **Return value**
...@@ -584,13 +583,13 @@ SystemCapability.BundleManager.BundleFramework ...@@ -584,13 +583,13 @@ SystemCapability.BundleManager.BundleFramework
**System API** **System API**
This is a system API. This is a system API and cannot be called by third-party applications.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ---------- | ------------------- | ---- |--------------------------------| | ---------- | ------------------- | ---- |--------------------------------|
| bundleName | string | Yes | Bundle name. | | bundleName | string | Yes | Bundle name of the application. |
| isEnable | boolean | Yes | Whether to enable the application. The value **true** means to enable the application, and **false** means the opposite.| | isEnable | boolean | Yes | Whether to enable the application. The value **true** means to enable the application, and **false** means the opposite.|
| callback | AsyncCallback\<void> | Yes | Callback used to return the result. | | callback | AsyncCallback\<void> | Yes | Callback used to return the result. |
...@@ -626,13 +625,13 @@ SystemCapability.BundleManager.BundleFramework ...@@ -626,13 +625,13 @@ SystemCapability.BundleManager.BundleFramework
**System API** **System API**
This is a system API. This is a system API and cannot be called by third-party applications.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ---------- | ------- | ---- | ----------------------------------------------- | | ---------- | ------- | ---- |------------------------------|
| bundleName | string | Yes | Bundle name. | | bundleName | string | Yes | Bundle name of the application. |
| isEnable | boolean | Yes | Whether to enable the application. The value **true** means to enable the application, and **false** means the opposite.| | isEnable | boolean | Yes | Whether to enable the application. The value **true** means to enable the application, and **false** means the opposite.|
**Return value** **Return value**
...@@ -646,7 +645,7 @@ This is a system API. ...@@ -646,7 +645,7 @@ This is a system API.
```ts ```ts
let bundleName = "com.example.myapplication"; let bundleName = "com.example.myapplication";
bundleManager.setApplicationEnabled(bundleName, false).then(()=> { bundle.setApplicationEnabled(bundleName, false).then(()=> {
console.info('setApplicationEnabled successfully.'); console.info('setApplicationEnabled successfully.');
}).catch(err=> { }).catch(err=> {
console.error('setApplicationEnabled failed.'); console.error('setApplicationEnabled failed.');
...@@ -671,7 +670,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -671,7 +670,7 @@ SystemCapability.BundleManager.BundleFramework
**System API** **System API**
This is a system API. This is a system API and cannot be called by third-party applications.
**Parameters** **Parameters**
...@@ -699,7 +698,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -699,7 +698,7 @@ SystemCapability.BundleManager.BundleFramework
**System API** **System API**
This is a system API. This is a system API and cannot be called by third-party applications.
**Parameters** **Parameters**
...@@ -721,7 +720,7 @@ let flag = bundle.BundleFlag.GET_ABILITY_INFO_WITH_PERMISSION; ...@@ -721,7 +720,7 @@ let flag = bundle.BundleFlag.GET_ABILITY_INFO_WITH_PERMISSION;
let userId = 100; let userId = 100;
let want = { let want = {
bundleName : "com.example.myapplication", bundleName : "com.example.myapplication",
abilityName : "EntryAbility" abilityName : "com.example.myapplication.MainAbility"
}; };
bundle.getAbilityInfo(want, flag, userId).then((abilityInfo) => { bundle.getAbilityInfo(want, flag, userId).then((abilityInfo) => {
...@@ -754,7 +753,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -754,7 +753,7 @@ SystemCapability.BundleManager.BundleFramework
**System API** **System API**
This is a system API. This is a system API and cannot be called by third-party applications.
**Parameters** **Parameters**
...@@ -767,7 +766,7 @@ This is a system API. ...@@ -767,7 +766,7 @@ This is a system API.
```ts ```ts
let permission = "ohos.permission.GET_BUNDLE_INFO"; let permission = "ohos.permission.GET_BUNDLE_INFO";
bundleManager.getPermissionDef(permission, (err, data) => { bundle.getPermissionDef(permission, (err, data) => {
if (err) { if (err) {
console.error('getPermissionDef failed:' + err.message); console.error('getPermissionDef failed:' + err.message);
} else { } else {
...@@ -794,7 +793,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -794,7 +793,7 @@ SystemCapability.BundleManager.BundleFramework
**System API** **System API**
This is a system API. This is a system API and cannot be called by third-party applications.
**Parameters** **Parameters**
...@@ -957,7 +956,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -957,7 +956,7 @@ SystemCapability.BundleManager.BundleFramework
**Return value** **Return value**
| Type | Description | | Type | Description |
| ---------------------------------------------------- | ------------------------------------------------------------ | | -------------- | -------------------------------------- |
| Promise\<[BundleInfo](js-apis-bundle-BundleInfo.md)> | Promise used to return the information about the bundles.| | Promise\<[BundleInfo](js-apis-bundle-BundleInfo.md)> | Promise used to return the information about the bundles.|
**Example** **Example**
...@@ -1007,6 +1006,7 @@ bundle.getBundleArchiveInfo(hapFilePath, bundleFlags, (err, data) => { ...@@ -1007,6 +1006,7 @@ bundle.getBundleArchiveInfo(hapFilePath, bundleFlags, (err, data) => {
}) })
``` ```
## bundle.getAbilityInfo<sup>deprecated<sup> ## bundle.getAbilityInfo<sup>deprecated<sup>
> This API is deprecated since API version 9. You are advised to use [bundleManager.queryAbilityInfo](js-apis-bundleManager.md#bundlemanagerqueryabilityinfo) instead. > This API is deprecated since API version 9. You are advised to use [bundleManager.queryAbilityInfo](js-apis-bundleManager.md#bundlemanagerqueryabilityinfo) instead.
...@@ -1029,7 +1029,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -1029,7 +1029,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ----------- | ------ | ---- |------------| | ----------- | ------ | ---- |------------|
| bundleName | string | Yes | Bundle name.| | bundleName | string | Yes | Bundle name of the application. |
| abilityName | string | Yes | Ability name.| | abilityName | string | Yes | Ability name.|
**Return value** **Return value**
...@@ -1042,7 +1042,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -1042,7 +1042,7 @@ SystemCapability.BundleManager.BundleFramework
```ts ```ts
let bundleName = "com.example.myapplication"; let bundleName = "com.example.myapplication";
let abilityName = "EntryAbility"; let abilityName = "com.example.myapplication.MainAbility";
bundle.getAbilityInfo(bundleName, abilityName) bundle.getAbilityInfo(bundleName, abilityName)
.then((data) => { .then((data) => {
console.info('Operation successful. Data: ' + JSON.stringify(data)); console.info('Operation successful. Data: ' + JSON.stringify(data));
...@@ -1073,7 +1073,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -1073,7 +1073,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ----------- | ------------ | ---- |----------------------------| | ----------- | ------------ | ---- |----------------------------|
| bundleName | string | Yes | Bundle name. | | bundleName | string | Yes | Bundle name of the application. |
| abilityName | string | Yes | Ability name. | | abilityName | string | Yes | Ability name. |
| callback | AsyncCallback\<[AbilityInfo](js-apis-bundle-AbilityInfo.md)> | Yes | Callback used to return the ability information.| | callback | AsyncCallback\<[AbilityInfo](js-apis-bundle-AbilityInfo.md)> | Yes | Callback used to return the ability information.|
...@@ -1081,7 +1081,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -1081,7 +1081,7 @@ SystemCapability.BundleManager.BundleFramework
```ts ```ts
let bundleName = "com.example.myapplication"; let bundleName = "com.example.myapplication";
let abilityName = "EntryAbility"; let abilityName = "com.example.myapplication.MainAbility";
bundle.getAbilityInfo(bundleName, abilityName, (err, data) => { bundle.getAbilityInfo(bundleName, abilityName, (err, data) => {
if (err) { if (err) {
console.error('Operation failed. Cause: ' + JSON.stringify(err)); console.error('Operation failed. Cause: ' + JSON.stringify(err));
...@@ -1111,10 +1111,10 @@ SystemCapability.BundleManager.BundleFramework ...@@ -1111,10 +1111,10 @@ SystemCapability.BundleManager.BundleFramework
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | ------ | ---- | ---------------- | |-------------|--------|-----|------------|
| bundleName | string | Yes | Bundle name.| | bundleName | string | Yes | Bundle name of the application. |
| abilityName | string | Yes | Ability name. | | abilityName | string | Yes | Ability name.|
**Return value** **Return value**
...@@ -1126,7 +1126,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -1126,7 +1126,7 @@ SystemCapability.BundleManager.BundleFramework
```ts ```ts
let bundleName = "com.example.myapplication"; let bundleName = "com.example.myapplication";
let abilityName = "EntryAbility"; let abilityName = "com.example.myapplication.MainAbility";
bundle.getAbilityLabel(bundleName, abilityName) bundle.getAbilityLabel(bundleName, abilityName)
.then((data) => { .then((data) => {
console.info('Operation successful. Data: ' + JSON.stringify(data)); console.info('Operation successful. Data: ' + JSON.stringify(data));
...@@ -1155,9 +1155,9 @@ SystemCapability.BundleManager.BundleFramework ...@@ -1155,9 +1155,9 @@ SystemCapability.BundleManager.BundleFramework
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | ---------------------- | ---- | ---------------------------------------------- | |-------------|------------------------|-----|-------------------------|
| bundleName | string | Yes | Bundle name. | | bundleName | string | Yes | Bundle name of the application. |
| abilityName | string | Yes | Ability name. | | abilityName | string | Yes | Ability name. |
| callback | AsyncCallback\<string> | Yes | Callback used to return the application name.| | callback | AsyncCallback\<string> | Yes | Callback used to return the application name.|
...@@ -1165,7 +1165,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -1165,7 +1165,7 @@ SystemCapability.BundleManager.BundleFramework
```ts ```ts
let bundleName = "com.example.myapplication"; let bundleName = "com.example.myapplication";
let abilityName = "EntryAbility"; let abilityName = "com.example.myapplication.MainAbility";
bundle.getAbilityLabel(bundleName, abilityName, (err, data) => { bundle.getAbilityLabel(bundleName, abilityName, (err, data) => {
if (err) { if (err) {
console.error('Operation failed. Cause: ' + JSON.stringify(err)); console.error('Operation failed. Cause: ' + JSON.stringify(err));
...@@ -1203,7 +1203,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -1203,7 +1203,7 @@ SystemCapability.BundleManager.BundleFramework
```ts ```ts
let bundleName = "com.example.myapplication"; let bundleName = "com.example.myapplication";
let abilityName = "EntryAbility"; let abilityName = "com.example.myapplication.MainAbility";
bundle.getAbilityInfo(bundleName, abilityName).then((abilityInfo)=>{ bundle.getAbilityInfo(bundleName, abilityName).then((abilityInfo)=>{
bundle.isAbilityEnabled(abilityInfo).then((data) => { bundle.isAbilityEnabled(abilityInfo).then((data) => {
console.info('Operation successful. Data: ' + JSON.stringify(data)); console.info('Operation successful. Data: ' + JSON.stringify(data));
...@@ -1236,7 +1236,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -1236,7 +1236,7 @@ SystemCapability.BundleManager.BundleFramework
```ts ```ts
let bundleName = "com.example.myapplication"; let bundleName = "com.example.myapplication";
let abilityName = "EntryAbility"; let abilityName = "com.example.myapplication.MainAbility";
bundle.getAbilityInfo(bundleName, abilityName).then((abilityInfo)=>{ bundle.getAbilityInfo(bundleName, abilityName).then((abilityInfo)=>{
bundle.isAbilityEnabled(abilityInfo, (err, data) => { bundle.isAbilityEnabled(abilityInfo, (err, data) => {
if (err) { if (err) {
...@@ -1264,7 +1264,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -1264,7 +1264,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ---------- | ------ | ---- | ------------------------ | | ---------- | ------ | ---- | ------------------------ |
| bundleName | string | Yes | Bundle name.| | bundleName | string | Yes | Bundle name of the application.|
**Return value** **Return value**
...@@ -1300,7 +1300,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -1300,7 +1300,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ---------- | ----------------------- | ---- | ------------------------ | | ---------- | ----------------------- | ---- | ------------------------ |
| bundleName | string | Yes | Bundle name.| | bundleName | string | Yes | Bundle name of the application.|
| callback | AsyncCallback\<boolean> | Yes | Callback used to return the result. If the application is enabled, **true** will be returned; otherwise, **false** will be returned.| | callback | AsyncCallback\<boolean> | Yes | Callback used to return the result. If the application is enabled, **true** will be returned; otherwise, **false** will be returned.|
**Example** **Example**
...@@ -1338,7 +1338,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -1338,7 +1338,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ----------- | ------ | ---- | ------------------------------------- | | ----------- | ------ | ---- | ------------------------------------- |
| want | [Want](js-apis-application-want.md) | Yes | Want containing the bundle name | | want | [Want](js-apis-application-want.md) | Yes | Want containing the bundle name. |
| bundleFlags | number | Yes | Ability information to be returned. For details about the available enumerated values, see the ability information flags in [BundleFlag](#bundleflagdeprecated).| | bundleFlags | number | Yes | Ability information to be returned. For details about the available enumerated values, see the ability information flags in [BundleFlag](#bundleflagdeprecated).|
| userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. | | userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. |
...@@ -1355,7 +1355,7 @@ let bundleFlags = 0; ...@@ -1355,7 +1355,7 @@ let bundleFlags = 0;
let userId = 100; let userId = 100;
let want = { let want = {
bundleName : "com.example.myapplication", bundleName : "com.example.myapplication",
abilityName : "EntryAbility" abilityName : "com.example.myapplication.MainAbility"
}; };
bundle.queryAbilityByWant(want, bundleFlags, userId) bundle.queryAbilityByWant(want, bundleFlags, userId)
.then((data) => { .then((data) => {
...@@ -1387,8 +1387,8 @@ SystemCapability.BundleManager.BundleFramework ...@@ -1387,8 +1387,8 @@ SystemCapability.BundleManager.BundleFramework
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | |-------------|---------------------------------------------------------------------|-----|-------------------------------------------------------------------------|
| want | [Want](js-apis-application-want.md) | Yes | Want containing the bundle name. | | want | [Want](js-apis-application-want.md) | Yes | Want containing the bundle name. |
| bundleFlags | number | Yes | Ability information to be returned. For details about the available enumerated values, see the ability information flags in [BundleFlag](#bundleflagdeprecated).| | bundleFlags | number | Yes | Ability information to be returned. For details about the available enumerated values, see the ability information flags in [BundleFlag](#bundleflagdeprecated).|
| userId | number | Yes | User ID. The value must be greater than or equal to 0. | | userId | number | Yes | User ID. The value must be greater than or equal to 0. |
...@@ -1401,7 +1401,7 @@ let bundleFlags = 0; ...@@ -1401,7 +1401,7 @@ let bundleFlags = 0;
let userId = 100; let userId = 100;
let want = { let want = {
bundleName : "com.example.myapplication", bundleName : "com.example.myapplication",
abilityName : "EntryAbility" abilityName : "com.example.myapplication.MainAbility"
}; };
bundle.queryAbilityByWant(want, bundleFlags, userId, (err, data) => { bundle.queryAbilityByWant(want, bundleFlags, userId, (err, data) => {
if (err) { if (err) {
...@@ -1432,8 +1432,8 @@ SystemCapability.BundleManager.BundleFramework ...@@ -1432,8 +1432,8 @@ SystemCapability.BundleManager.BundleFramework
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | |-------------|---------------------------------------------------------------------|-----|-------------------------------------------------------------------------|
| want | [Want](js-apis-application-want.md) | Yes | Want containing the bundle name. | | want | [Want](js-apis-application-want.md) | Yes | Want containing the bundle name. |
| bundleFlags | number | Yes | Ability information to be returned. For details about the available enumerated values, see the ability information flags in [BundleFlag](#bundleflagdeprecated).| | bundleFlags | number | Yes | Ability information to be returned. For details about the available enumerated values, see the ability information flags in [BundleFlag](#bundleflagdeprecated).|
| callback | AsyncCallback<Array\<[AbilityInfo](js-apis-bundle-AbilityInfo.md)>> | Yes | Callback used to return the ability information. | | callback | AsyncCallback<Array\<[AbilityInfo](js-apis-bundle-AbilityInfo.md)>> | Yes | Callback used to return the ability information. |
...@@ -1444,7 +1444,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -1444,7 +1444,7 @@ SystemCapability.BundleManager.BundleFramework
let bundleFlags = 0; let bundleFlags = 0;
let want = { let want = {
bundleName : "com.example.myapplication", bundleName : "com.example.myapplication",
abilityName : "EntryAbility" abilityName : "com.example.myapplication.MainAbility"
}; };
bundle.queryAbilityByWant(want, bundleFlags, (err, data) => { bundle.queryAbilityByWant(want, bundleFlags, (err, data) => {
if (err) { if (err) {
...@@ -1477,7 +1477,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -1477,7 +1477,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ---------- | ------ | ---- | ------------------------ | | ---------- | ------ | ---- | ------------------------ |
| bundleName | string | Yes | Bundle name.| | bundleName | string | Yes | Bundle name of the application.|
**Return value** **Return value**
| Type | Description | | Type | Description |
...@@ -1516,7 +1516,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -1516,7 +1516,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ---------- | --------------------------------------------------- | ---- | -------------------------------------------------------- | | ---------- | --------------------------------------------------- | ---- | -------------------------------------------------------- |
| bundleName | string | Yes | Bundle name. | | bundleName | string | Yes | Bundle name of the application. |
| callback | AsyncCallback\<[Want](js-apis-application-want.md)> | Yes | Callback used to return the **Want** object.| | callback | AsyncCallback\<[Want](js-apis-application-want.md)> | Yes | Callback used to return the **Want** object.|
**Example** **Example**
...@@ -1582,8 +1582,8 @@ SystemCapability.BundleManager.BundleFramework ...@@ -1582,8 +1582,8 @@ SystemCapability.BundleManager.BundleFramework
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------- | ---- | ----------------------------------------------------- | |----------|------------------------|-----|----------------------------|
| uid | number | Yes | UID based on which the bundle name is to obtain. | | uid | number | Yes | UID based on which the bundle name is to obtain. |
| callback | AsyncCallback\<string> | Yes | Callback used to return the bundle name.| | callback | AsyncCallback\<string> | Yes | Callback used to return the bundle name.|
...@@ -1622,9 +1622,9 @@ SystemCapability.BundleManager.BundleFramework ...@@ -1622,9 +1622,9 @@ SystemCapability.BundleManager.BundleFramework
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ----------- | ------ | ---- | ------------------------ | | ----------- | ------ | ---- |-----------------|
| bundleName | string | Yes | Bundle name.| | bundleName | string | Yes | Bundle name of the application. |
| abilityName | string | Yes | Ability name. | | abilityName | string | Yes | Ability name.|
**Return value** **Return value**
| Type | Description | | Type | Description |
...@@ -1635,7 +1635,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -1635,7 +1635,7 @@ SystemCapability.BundleManager.BundleFramework
```ts ```ts
let bundleName = "com.example.myapplication"; let bundleName = "com.example.myapplication";
let abilityName = "EntryAbility"; let abilityName = "com.example.myapplication.MainAbility";
bundle.getAbilityIcon(bundleName, abilityName) bundle.getAbilityIcon(bundleName, abilityName)
.then((data) => { .then((data) => {
console.info('Operation successful. Data: ' + JSON.stringify(data)); console.info('Operation successful. Data: ' + JSON.stringify(data));
...@@ -1667,7 +1667,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -1667,7 +1667,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ----------- | ---------------------------------------- | ---- |-------------------------------------------------| | ----------- | ---------------------------------------- | ---- |-------------------------------------------------|
| bundleName | string | Yes | Bundle name. | | bundleName | string | Yes | Bundle name of the application. |
| abilityName | string | Yes | Ability name. | | abilityName | string | Yes | Ability name. |
| callback | AsyncCallback\<image.PixelMap> | Yes | Callback used to return the [pixel map](js-apis-image.md).| | callback | AsyncCallback\<image.PixelMap> | Yes | Callback used to return the [pixel map](js-apis-image.md).|
...@@ -1675,7 +1675,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -1675,7 +1675,7 @@ SystemCapability.BundleManager.BundleFramework
```ts ```ts
let bundleName = "com.example.myapplication"; let bundleName = "com.example.myapplication";
let abilityName = "EntryAbility"; let abilityName = "com.example.myapplication.MainAbility";
bundle.getAbilityIcon(bundleName, abilityName, (err, data) => { bundle.getAbilityIcon(bundleName, abilityName, (err, data) => {
if (err) { if (err) {
console.error('Operation failed. Cause: ' + JSON.stringify(err)); console.error('Operation failed. Cause: ' + JSON.stringify(err));
......
...@@ -24,7 +24,7 @@ For details, see [Permission Levels](../../security/accesstoken-overview.md). ...@@ -24,7 +24,7 @@ For details, see [Permission Levels](../../security/accesstoken-overview.md).
**System capability**: SystemCapability.BundleManager.BundleFramework.Core **System capability**: SystemCapability.BundleManager.BundleFramework.Core
**System API**: This is a system API and cannot be called by third-party applications. **System API**: This is a system API.
| Name | Template | Readable| Writable| Description | | Name | Template | Readable| Writable| Description |
| ---------- | ------ | ---- | ---- | -------------------------- | | ---------- | ------ | ---- | ---- | -------------------------- |
...@@ -53,7 +53,7 @@ Subscribes to bundle installation, uninstall, and update events. ...@@ -53,7 +53,7 @@ Subscribes to bundle installation, uninstall, and update events.
**Required permissions**: ohos.permission.LISTEN_BUNDLE_CHANGE **Required permissions**: ohos.permission.LISTEN_BUNDLE_CHANGE
**System API**: This is a system API and cannot be called by third-party applications. **System API**: This is a system API.
**System capability**: SystemCapability.BundleManager.BundleFramework.Core **System capability**: SystemCapability.BundleManager.BundleFramework.Core
...@@ -61,7 +61,7 @@ Subscribes to bundle installation, uninstall, and update events. ...@@ -61,7 +61,7 @@ Subscribes to bundle installation, uninstall, and update events.
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ---------------------------- | -------- | ---- | ------------------ | | ---------------------------- | -------- | ---- | ------------------ |
| type| [BundleChangedEvent](js-apis-bundleMonitor.md#BundleChangedEvent)| Yes | Type of the event to subscribe to.| | type| [BundleChangedEvent](js-apis-bundleMonitor.md#bundlechangedevent)| Yes | Type of the event to subscribe to.|
| callback | callback\<BundleChangedInfo>| Yes | Callback used for the subscription.| | callback | callback\<BundleChangedInfo>| Yes | Callback used for the subscription.|
**Example** **Example**
...@@ -86,7 +86,7 @@ Unsubscribes from bundle installation, uninstall, and update events. ...@@ -86,7 +86,7 @@ Unsubscribes from bundle installation, uninstall, and update events.
**Required permissions**: ohos.permission.LISTEN_BUNDLE_CHANGE **Required permissions**: ohos.permission.LISTEN_BUNDLE_CHANGE
**System API**: This is a system API and cannot be called by third-party applications. **System API**: This is a system API.
**System capability**: SystemCapability.BundleManager.BundleFramework.Core **System capability**: SystemCapability.BundleManager.BundleFramework.Core
...@@ -94,8 +94,8 @@ Unsubscribes from bundle installation, uninstall, and update events. ...@@ -94,8 +94,8 @@ Unsubscribes from bundle installation, uninstall, and update events.
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ---------------------------- | -------- | ---- | ---------------------------------------------------------- | | ---------------------------- | -------- | ---- | ---------------------------------------------------------- |
| type| [BundleChangedEvent](js-apis-bundleMonitor.md#BundleChangedEvent)| Yes | Type of the event to unsubscribe from. | | type| [BundleChangedEvent](js-apis-bundleMonitor.md#bundlechangedevent)| Yes | Type of the event to unsubscribe from. |
| callback | callback\<BundleChangedInfo>| No | Callback used for the unsubscription. If this parameter is left empty, all callbacks of the current event are unsubscribed from.| | callback | callback\<BundleChangedInfo>| No | Callback used for the unsubscription. By default, no value is passed, and all callbacks of the current event are unsubscribed from.|
**Example** **Example**
......
...@@ -240,7 +240,7 @@ Decompresses a file. This API uses an asynchronous callback to return the result ...@@ -240,7 +240,7 @@ Decompresses a file. This API uses an asynchronous callback to return the result
For details about the error codes, see [zlib Error Codes](../errorcodes/errorcode-zlib.md). For details about the error codes, see [zlib Error Codes](../errorcodes/errorcode-zlib.md).
| ID| Error Message | ID| Error Message |
| -------- | --------------------------------------| | -------- | --------------------------------------|
| 900001 | The Input source file is invalid. | | 900001 | The Input source file is invalid. |
| 900002 | The Input destination file is invalid. | | 900002 | The Input destination file is invalid. |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册