From 333e04384de7381cccfd26c19fb7ad90ed4e0109 Mon Sep 17 00:00:00 2001 From: junyi233 Date: Wed, 26 Apr 2023 06:09:02 +0000 Subject: [PATCH] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E5=85=AC=E5=85=B1=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E8=B5=84=E6=96=99=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: junyi233 --- .../common_event/commonEvent-bundleManager.md | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 zh-cn/application-dev/reference/apis/common_event/commonEvent-bundleManager.md diff --git a/zh-cn/application-dev/reference/apis/common_event/commonEvent-bundleManager.md b/zh-cn/application-dev/reference/apis/common_event/commonEvent-bundleManager.md new file mode 100644 index 0000000000..0b5806f056 --- /dev/null +++ b/zh-cn/application-dev/reference/apis/common_event/commonEvent-bundleManager.md @@ -0,0 +1,46 @@ +# 包管理子系统公共事件定义 +包管理服务框架面向应用发布如下系统公共事件。 + +## COMMON_EVENT_PACKAGE_ADDED + +表示设备上已安装新应用包的公共事件的动作。 + +- 常量值:"usual.event.PACKAGE_ADDED" +- 订阅方需要的权限:无 + +在设备上指定用户下安装了新的应用程序,将会触发事件通知服务发布该系统公共事件。 + +与这个公共事件相关的接口:install,具体参看[接口文档](../js-apis-installer.md#bundleinstallerinstall)。 + +## COMMON_EVENT_PACKAGE_REMOVED + +表示已从设备卸载已安装的应用程序,但应用程序数据保留的公共事件的操作。 + +- 常量值:"usual.event.PACKAGE_REMOVED" +- 订阅方需要的权限:无 + +在设备指定用户下卸载指定的应用程序包,将会触发事件通知服务发布该系统公共事件。 + +与这个公共事件相关的接口:uninstall,具体参看[接口文档](../js-apis-installer.md#bundleinstalleruninstall)。 + +## COMMON_EVENT_PACKAGE_CHANGED + +表示应用包已更改的公共事件的动作(例如,包中的组件已启用或禁用)。 + +- 常量值:"usual.event.PACKAGE_CHANGED" +- 订阅方需要的权限:无 + +在设备上安装的应用程序包更新或者包的组件被禁用使能,将会触发事件通知服务发布该系统公共事件。 + +与这个公共事件相关的接口:setApplicationEnabled 和 setAbilityEnabled,具体参看[接口文档](../js-apis-bundleManager.md#bundlemanagersetapplicationenabled)。 + +## COMMON_EVENT_PACKAGE_CACHE_CLEARED + +表示用户清除应用包缓存数据的公共事件的动作。 + +- 常量值:"usual.event.PACKAGE_CACHE_CLEARED" +- 订阅方需要的权限:无 + +对设备上安装的应用程序包清除缓存时,将会触发事件通知服务发布该系统公共事件。 + +与这个公共事件相关的接口:cleanBundleCacheFiles,具体参看[接口文档](../js-apis-bundleManager.md#bundlemanagercleanbundlecachefiles)。 -- GitLab