README.md
1# bundlemanager_ecological_rule_manager
2
3### Introduction
4The ecological rule manager service provides a system extension capability, where device manufacturers can control the behavior of applications (such as jumping, adding desktop cards, and installing atomic services) on customized devices (such as 2B cooperation projects), thereby customizing user experiences that meet the manufacturer's control requirements.
5
6### Software Architecture
7![image](figures/architecture.jpg)
8
9The following describes the key fields in the preceding figure:
10
11- `App`: App will be managed by ecological rule manager service when opening atomic services.
12- `AbilityManagerService`: AbilityManagerService is a system service used to coordinate the operational relationships of various capabilities and schedule the lifecycle.
13- `FormManagerService`: FormManagerService is responsible for managing the lifecycle of cards, maintaining card information, and scheduling card events.
14- `BundleManagerService`: BundleManagerService is responsible for managing application installation packages, providing capabilities such as querying, installing, updating, uninstalling, and storing package information for installation packages.
15- `EcologicalRuleManagerService`: EcologicalRuleManagerService is responsible for managing behaviors such as pulling up and adding tables of atomic services.
16
17### Directory Structure
18
19```shell
20/foundation/bundlemanager/ecological_rule_mgr # EcologicalRuleManagerService code
21├── etc
22│ └── init # SA startup configuration file
23├── interfaces # Interface Code
24│ └── innerkits # Internal interface
25├── profile # Service Profile
26├── services # Service Code
27├── LICENSE # Certificate file
28├── tests # Developer test
29└── utils # Tools
30```
31### build
32
33In the root directory of the OpenHarmony source code, invoke the following command to compile ecological_rule_manager:
34```shell
35./build.sh --product-name rk3568 --ccache --build-target ecological_rule_manager
36```
37> **Note:**
38--product-name: product name, for example, Hi3516D V300 or rk3568.
39--ccache: The cache function is used during compilation.
40--build-target: name of the compiled component.
41
42### Interface Usage Description
43The ecological rule manager service only opens internal interfaces to system services, and the system can expand the interface functions according to actual needs.
44|interface|description|
45|---|---|
46|QueryStartExperience(const Want &want, const CallerInfo &callerInfo, ExperienceRule &rule):int32_t|This interface is provided for AbilityManagerService and invoked when the atomic services is enabled. ExperienceRule is a return value, indicating whether the atomic services can be opened, the specific experience Want can be returned when the value is not allowed.|
47|QueryFreeInstallExperience(const Want &want, const CallerInfo &callerInfo ExperienceRule &rule):int32_t|This interface is provided for BundleManagerService and invoked when the atomic service is installation-free. This parameter is used to determine whether installation-free is allowed, the specific experience Want can be returned when installation-free is not allowed.|
48|IsSupportPublishForm(const vector<AAFwk::Want> &wants, const CallerInfo &callerInfo, bool &bSupport):int32_t|This interface is provided for FormManagerService and invoked when cards are added to tables, which is used to determine whether atomic services can be added to table.|
49|EvaluateResolveInfos(const Want &want, const CallerInfo &callerInfo, int32_t type,std::vector<AbilityInfo> &abilityInfos):int32_t|This interface is provided for AbilityManagerService to filter out prohibited providers.|
README_zh.md
1# bundlemanager_ecological_rule_manager
2
3### 简介
4生态规则管控服务提供一种系统的扩展能力,设备厂商可以在定制设备上(2B合作项目等),对应用的行为(跳转、添加桌面卡片、免安装元服务)进行管控,从而定制出满足厂商管控要求的用户体验。
5
6
7### 软件架构
8![image](figures/architecture_zh.jpg)
9
10以下是对于上图关键字段的描述信息:
11
12- `App`:App,在打开元服务时会受到生态规则服务的管控。
13- `AbilityManagerService`:元能力管理服务,用于协调各Ability运行关系、及对生命周期进行调度的系统服务。
14- `FormManagerService`:卡片管理服务,管理卡片的生命周期,并维护卡片信息以及卡片事件的调度。
15- `BundleManagerService`:包管理服务,负责应用安装包的管理,提供安装包的信息查询、安装、更新、卸载和包信息存储等能力。
16- `EcologicalRuleManagerService`:生态规则管控服务,对元服务的拉起,加桌等行为进行管控。
17
18
19### 目录结构
20
21```shell
22/foundation/bundlemanager/ecological_rule_mgr # 生态规则管控服务业务代码
23├── etc
24│ └── init # SA启动配置文件
25├── interfaces # 接口代码
26│ └── innerkits # 内部接口
27├── profile # 服务配置文件
28├── services # 服务代码
29├── LICENSE # 证书文件
30├── tests # 开发者测试
31└── utils # 工具类
32```
33### 编译构建
34
35在OpenHarmony源码根目录下,调用以下指令,单独编译ecological_rule_manager。
36```shell
37./build.sh --product-name rk3568 --ccache --build-target ecological_rule_manager
38```
39> **说明:**
40--product-name:产品名称,例如Hi3516DV300、rk3568等。
41--ccache:编译时使用缓存功能。
42--build-target: 编译的部件名称。
43
44### 接口使用说明
45生态规则管控服务只对系统服务开放内部接口,系统根据实际需要进行接口功能扩展。
46|接口|说明|
47|---|---|
48|QueryStartExperience(const Want &want, const CallerInfo &callerInfo, ExperienceRule &rule):int32_t|提供给AbilityManagerService使用,在元服务打开时调用。ExperienceRule为返回值,返回是否允许打开;不允许时可以返回具体的体验Want。|
49|QueryFreeInstallExperience(const Want &want, const CallerInfo &callerInfo ExperienceRule &rule):int32_t|提供给BundleManagerService使用,在元服务免安装时调用。用于判断是否允许免安装,不允许时可以返回具体的体验Want。|
50|IsSupportPublishForm(const vector<AAFwk::Want> &wants, const CallerInfo &callerInfo, bool &bSupport):int32_t|提供给FormManagerService使用,在卡片加桌时调用。用于判断是否允许加桌|
51|EvaluateResolveInfos(const Want &want, const CallerInfo &callerInfo, int32_t type,std::vector<AbilityInfo> &abilityInfos):int32_t|提供给AbilityManagerService使用,支持过滤掉禁止出现的提供者|
52
53