diff --git a/zh-cn/application-dev/reference/apis/js-apis-bundleManager.md b/zh-cn/application-dev/reference/apis/js-apis-bundleManager.md index ded0b7d96aea971142e1152927218be388d8f11f..7f12f844071b9535e822e28d41b302c3e11153bd 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-bundleManager.md +++ b/zh-cn/application-dev/reference/apis/js-apis-bundleManager.md @@ -19,6 +19,7 @@ import bundleManager from '@ohos.bundle.bundleManager'; | ohos.permission.GET_BUNDLE_INFO_PRIVILEGED | system_basic | 可查询所有应用信息。 | | ohos.permission.REMOVE_CACHE_FILES | system_basic | 清理应用缓存。 | |ohos.permission.CHANGE_ABILITY_ENABLED_STATE| system_basic | 设置禁用使能所需的权限。 | +| ohos.permission.GET_INSTALLED_BUNDLE_LIST | system_basic | 读取已安装应用列表。 | 权限等级参考[权限等级说明](../../security/accesstoken-overview.md#权限等级说明)。 @@ -676,7 +677,7 @@ getAllBundleInfo(bundleFlags: [number](#bundleflag), userId: number, callback: A **系统接口:** 此接口为系统接口。 -**需要权限:** ohos.permission.GET_BUNDLE_INFO_PRIVILEGED +**需要权限:** ohos.permission.GET_INSTALLED_BUNDLE_LIST **系统能力:** SystemCapability.BundleManager.BundleFramework.Core @@ -725,7 +726,7 @@ getAllBundleInfo(bundleFlags: [number](#bundleflag), callback: AsyncCallback +升级新版本镜像后,使用@ohos.bundle.d.ts中的getAllBundleInfo的接口调用成功后返回数据列表为空。需要应用调用新的接口@ohos.bundle.bundleManager.d.ts中的getAllBundleInfo。 + +**关键的接口/组件变更**
+底层实现变更,使用@ohos.bundle.d.ts中的getAllBundleInfo的接口调用成功后返回数据列表为空。 + +**适配指导**
+1. 应用在使用@ohos.bundle.d.ts中getAllBundleInfo接口的地方可以修改为使用@ohos.bundle.bundleManager.d.ts中getAllBundleInfo,新接口使用方法可参考[指南](../../../application-dev/reference/apis/js-apis-bundleManager.md#bundlemanagergetallbundleinfo)。 +```ets +import bundleManager from '@ohos.bundle.bundleManager'; +``` + +## cl.bundlemanager.2 包管理@ohos.bundle.bundleManager.d.ts中getAllApplicationInfo接口底层实现变更。 + +@ohos.bundle.d.ts中getAllApplicationInfo接口已标记废弃,在targetAPILevel为API9及之后的版本镜像上,返回数据列表为空。 + +**变更影响**
+升级新版本镜像后,使用@ohos.bundle.d.ts中的getAllApplicationInfo的接口调用成功后返回数据列表为空。需要应用调用新的接口@ohos.bundle.bundleManager.d.ts中的getAllApplicationInfo。 + +**关键的接口/组件变更**
+底层实现变更,使用@ohos.bundle.d.ts中的getAllApplicationInfo的接口调用成功后返回数据列表为空。 + +**适配指导**
+1. 应用在使用@ohos.bundle.d.ts中getAllApplicationInfo接口的地方可以修改为使用@ohos.bundle.bundleManager.d.ts中getAllApplicationInfo,新接口使用方法可参考[指南](../../../application-dev/reference/apis/js-apis-bundleManager.md#bundlemanagergetallapplicationinfo)。 +```ets +import bundleManager from '@ohos.bundle.bundleManager'; +``` + +## cl.bundlemanager.3 包管理@ohos.bundle.bundleManager.d.ts中getAllBundleInfo接口权限变更。 + +获取应用列表接口需要由用户选择是否同意授权,因此将 +@ohos.bundle.bundleManager.d.ts中getAllBundleInfo接口权限变更为ohos.permission.GET_INSTALLED_BUNDLE_LIST。 + +**变更影响**
+升级新版本镜像后,使用getAllBundleInfo的接口需要申请新的权限ohos.permission.GET_INSTALLED_BUNDLE_LIST,否则接口会调用失败。 + +**关键的接口/组件变更**
+@ohos.bundle.bundleManager.d.ts中getAllBundleInfo接口权限变更为ohos.permission.GET_INSTALLED_BUNDLE_LIST。 + +**适配指导**
+1. 应用可以在配置文件中新增申请权限ohos.permission.GET_INSTALLED_BUNDLE_LIST。 +2. 该权限为user_grant类型的,安装时默认不会授权,需要应用调用弹框接口由用户选择是否授权或者使用预授权进行授权。 +3. 使用弹框授权方式可以参考[向用户申请授权](../../../application-dev/security/accesstoken-guidelines.md#向用户申请授权)。 +4. 使用预授权方式可以参考[权限预授权](../../../application-dev/security/accesstoken-guidelines.md#user_grant权限预授权)。 + +## cl.bundlemanager.4 包管理@ohos.bundle.bundleManager.d.ts中getAllApplicationInfo接口权限变更。 + +获取应用列表接口需要由用户选择是否同意授权,因此将 +@ohos.bundle.bundleManager.d.ts中getAllApplicationInfo接口权限变更为ohos.permission.GET_INSTALLED_BUNDLE_LIST。 + +**变更影响**
+升级新版本镜像后,使用getAllApplicationInfo的接口需要申请新的权限ohos.permission.GET_INSTALLED_BUNDLE_LIST,否则接口会调用失败。 + +**关键的接口/组件变更**
+@ohos.bundle.bundleManager.d.ts中getAllApplicationInfo接口权限变更为ohos.permission.GET_INSTALLED_BUNDLE_LIST。 + +**适配指导**
+1. 应用可以在配置文件中新增申请权限ohos.permission.GET_INSTALLED_BUNDLE_LIST。 +2. 该权限为user_grant类型的,安装时默认不会授权,需要应用调用弹框接口由用户选择是否授权或者使用预授权进行授权。 +3. 使用弹框授权方式可以参考[向用户申请授权](../../../application-dev/security/accesstoken-guidelines.md#向用户申请授权)。 +4. 使用预授权方式可以参考[权限预授权](../../../application-dev/security/accesstoken-guidelines.md#user_grant权限预授权)。