1eace7efcSopenharmony_ci# Copyright (c) 2022-2024 Huawei Device Co., Ltd.
2eace7efcSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
3eace7efcSopenharmony_ci# you may not use this file except in compliance with the License.
4eace7efcSopenharmony_ci# You may obtain a copy of the License at
5eace7efcSopenharmony_ci#
6eace7efcSopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
7eace7efcSopenharmony_ci#
8eace7efcSopenharmony_ci# Unless required by applicable law or agreed to in writing, software
9eace7efcSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
10eace7efcSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11eace7efcSopenharmony_ci# See the License for the specific language governing permissions and
12eace7efcSopenharmony_ci# limitations under the License.
13eace7efcSopenharmony_ci
14eace7efcSopenharmony_ciimport("//build/ohos.gni")
15eace7efcSopenharmony_ciimport("//foundation/ability/ability_runtime/ability_runtime.gni")
16eace7efcSopenharmony_ci
17eace7efcSopenharmony_ciconfig("upms_config") {
18eace7efcSopenharmony_ci  visibility = [ ":*" ]
19eace7efcSopenharmony_ci  visibility += [ "${ability_runtime_test_path}/unittest/*" ]
20eace7efcSopenharmony_ci  include_dirs = [
21eace7efcSopenharmony_ci    "include",
22eace7efcSopenharmony_ci    "${ability_runtime_utils_path}/global/constant",
23eace7efcSopenharmony_ci  ]
24eace7efcSopenharmony_ci  cflags = []
25eace7efcSopenharmony_ci  if (target_cpu == "arm") {
26eace7efcSopenharmony_ci    cflags += [ "-DBINDER_IPC_32BIT" ]
27eace7efcSopenharmony_ci  }
28eace7efcSopenharmony_ci}
29eace7efcSopenharmony_ci
30eace7efcSopenharmony_cilibupms_sources = [
31eace7efcSopenharmony_ci  "src/file_permission_manager.cpp",
32eace7efcSopenharmony_ci  "src/media_permission_manager.cpp",
33eace7efcSopenharmony_ci  "src/tokenid_permission.cpp",
34eace7efcSopenharmony_ci  "src/uri_permission_manager_service.cpp",
35eace7efcSopenharmony_ci  "src/uri_permission_manager_stub_impl.cpp",
36eace7efcSopenharmony_ci  "src/uri_permission_utils.cpp",
37eace7efcSopenharmony_ci]
38eace7efcSopenharmony_ci
39eace7efcSopenharmony_ci#build so
40eace7efcSopenharmony_ciohos_shared_library("libupms") {
41eace7efcSopenharmony_ci  sanitize = {
42eace7efcSopenharmony_ci    cfi = true
43eace7efcSopenharmony_ci    cfi_cross_dso = true
44eace7efcSopenharmony_ci    debug = false
45eace7efcSopenharmony_ci  }
46eace7efcSopenharmony_ci  branch_protector_ret = "pac_ret"
47eace7efcSopenharmony_ci  shlib_type = "sa"
48eace7efcSopenharmony_ci  configs = [
49eace7efcSopenharmony_ci    "${ability_runtime_innerkits_path}/app_manager:appmgr_sdk_config",
50eace7efcSopenharmony_ci    "${ability_runtime_services_path}/common:common_config",
51eace7efcSopenharmony_ci    "${ability_runtime_services_path}/abilitymgr:abilityms_config",
52eace7efcSopenharmony_ci  ]
53eace7efcSopenharmony_ci  public_configs = [ ":upms_config" ]
54eace7efcSopenharmony_ci
55eace7efcSopenharmony_ci  include_dirs = [ "${ability_runtime_path}/interfaces/kits/native/appkit/ability_bundle_manager_helper" ]
56eace7efcSopenharmony_ci
57eace7efcSopenharmony_ci  sources = libupms_sources
58eace7efcSopenharmony_ci
59eace7efcSopenharmony_ci  deps = [
60eace7efcSopenharmony_ci    "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper",
61eace7efcSopenharmony_ci    "${ability_runtime_innerkits_path}/uri_permission:uri_permission_mgr",
62eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit:appkit_manager_helper",
63eace7efcSopenharmony_ci    "${ability_runtime_services_path}/common:app_util",
64eace7efcSopenharmony_ci    "${ability_runtime_services_path}/common:event_report",
65eace7efcSopenharmony_ci    "${ability_runtime_services_path}/common:perm_verification",
66eace7efcSopenharmony_ci  ]
67eace7efcSopenharmony_ci
68eace7efcSopenharmony_ci  external_deps = [
69eace7efcSopenharmony_ci    "ability_base:configuration",
70eace7efcSopenharmony_ci    "ability_base:want",
71eace7efcSopenharmony_ci    "ability_base:zuri",
72eace7efcSopenharmony_ci    "access_token:libaccesstoken_sdk",
73eace7efcSopenharmony_ci    "access_token:libtokenid_sdk",
74eace7efcSopenharmony_ci    "app_file_service:fileuri_native",
75eace7efcSopenharmony_ci    "background_task_mgr:bgtaskmgr_innerkits",
76eace7efcSopenharmony_ci    "bundle_framework:appexecfwk_base",
77eace7efcSopenharmony_ci    "bundle_framework:appexecfwk_core",
78eace7efcSopenharmony_ci    "c_utils:utils",
79eace7efcSopenharmony_ci    "common_event_service:cesfwk_core",
80eace7efcSopenharmony_ci    "common_event_service:cesfwk_innerkits",
81eace7efcSopenharmony_ci    "data_share:datashare_consumer",
82eace7efcSopenharmony_ci    "eventhandler:libeventhandler",
83eace7efcSopenharmony_ci    "graphic_2d:color_manager",
84eace7efcSopenharmony_ci    "hilog:libhilog",
85eace7efcSopenharmony_ci    "hisysevent:libhisysevent",
86eace7efcSopenharmony_ci    "hitrace:hitrace_meter",
87eace7efcSopenharmony_ci    "image_framework:image_native",
88eace7efcSopenharmony_ci    "init:libbeget_proxy",
89eace7efcSopenharmony_ci    "init:libbegetutil",
90eace7efcSopenharmony_ci    "ipc:ipc_core",
91eace7efcSopenharmony_ci    "media_library:media_library_manager",
92eace7efcSopenharmony_ci    "relational_store:native_dataability",
93eace7efcSopenharmony_ci    "relational_store:native_rdb",
94eace7efcSopenharmony_ci    "safwk:system_ability_fwk",
95eace7efcSopenharmony_ci    "samgr:samgr_proxy",
96eace7efcSopenharmony_ci    "storage_service:storage_manager_sa_proxy",
97eace7efcSopenharmony_ci  ]
98eace7efcSopenharmony_ci  if (ability_runtime_feature_sandboxmanager) {
99eace7efcSopenharmony_ci    external_deps += [ "sandbox_manager:libsandbox_manager_sdk" ]
100eace7efcSopenharmony_ci    defines = [ "ABILITY_RUNTIME_FEATURE_SANDBOXMANAGER" ]
101eace7efcSopenharmony_ci  }
102eace7efcSopenharmony_ci  if (ability_runtime_graphics) {
103eace7efcSopenharmony_ci    external_deps += [ "i18n:intl_util" ]
104eace7efcSopenharmony_ci  }
105eace7efcSopenharmony_ci
106eace7efcSopenharmony_ci  subsystem_name = "ability"
107eace7efcSopenharmony_ci  part_name = "ability_runtime"
108eace7efcSopenharmony_ci}
109eace7efcSopenharmony_ci
110eace7efcSopenharmony_ci# Note: Just for test
111eace7efcSopenharmony_ciohos_static_library("libupms_static") {
112eace7efcSopenharmony_ci  sanitize = {
113eace7efcSopenharmony_ci    cfi = true
114eace7efcSopenharmony_ci    cfi_cross_dso = true
115eace7efcSopenharmony_ci    debug = false
116eace7efcSopenharmony_ci    blocklist = "../../test/cfi_blocklist.txt"
117eace7efcSopenharmony_ci  }
118eace7efcSopenharmony_ci  branch_protector_ret = "pac_ret"
119eace7efcSopenharmony_ci  configs = [
120eace7efcSopenharmony_ci    "${ability_runtime_innerkits_path}/app_manager:appmgr_sdk_config",
121eace7efcSopenharmony_ci    "${ability_runtime_services_path}/common:common_config",
122eace7efcSopenharmony_ci  ]
123eace7efcSopenharmony_ci  public_configs = [ ":upms_config" ]
124eace7efcSopenharmony_ci
125eace7efcSopenharmony_ci  include_dirs = [ "${ability_runtime_path}/interfaces/kits/native/appkit/ability_bundle_manager_helper" ]
126eace7efcSopenharmony_ci
127eace7efcSopenharmony_ci  sources = libupms_sources
128eace7efcSopenharmony_ci
129eace7efcSopenharmony_ci  deps = [
130eace7efcSopenharmony_ci    "${ability_runtime_innerkits_path}/uri_permission:uri_permission_mgr",
131eace7efcSopenharmony_ci    "${ability_runtime_services_path}/common:app_util",
132eace7efcSopenharmony_ci    "${ability_runtime_services_path}/common:perm_verification",
133eace7efcSopenharmony_ci  ]
134eace7efcSopenharmony_ci
135eace7efcSopenharmony_ci  external_deps = [
136eace7efcSopenharmony_ci    "ability_base:configuration",
137eace7efcSopenharmony_ci    "ability_base:want",
138eace7efcSopenharmony_ci    "ability_base:zuri",
139eace7efcSopenharmony_ci    "ability_runtime:ability_deps_wrapper",
140eace7efcSopenharmony_ci    "access_token:libaccesstoken_sdk",
141eace7efcSopenharmony_ci    "app_file_service:fileuri_native",
142eace7efcSopenharmony_ci    "bundle_framework:appexecfwk_base",
143eace7efcSopenharmony_ci    "bundle_framework:appexecfwk_core",
144eace7efcSopenharmony_ci    "c_utils:utils",
145eace7efcSopenharmony_ci    "common_event_service:cesfwk_core",
146eace7efcSopenharmony_ci    "common_event_service:cesfwk_innerkits",
147eace7efcSopenharmony_ci    "data_share:datashare_consumer",
148eace7efcSopenharmony_ci    "hilog:libhilog",
149eace7efcSopenharmony_ci    "hitrace:hitrace_meter",
150eace7efcSopenharmony_ci    "image_framework:image_native",
151eace7efcSopenharmony_ci    "init:libbeget_proxy",
152eace7efcSopenharmony_ci    "init:libbegetutil",
153eace7efcSopenharmony_ci    "ipc:ipc_core",
154eace7efcSopenharmony_ci    "media_library:media_library_manager",
155eace7efcSopenharmony_ci    "safwk:system_ability_fwk",
156eace7efcSopenharmony_ci    "samgr:samgr_proxy",
157eace7efcSopenharmony_ci    "storage_service:storage_manager_sa_proxy",
158eace7efcSopenharmony_ci  ]
159eace7efcSopenharmony_ci
160eace7efcSopenharmony_ci  if (ability_runtime_feature_sandboxmanager) {
161eace7efcSopenharmony_ci    external_deps += [ "sandbox_manager:libsandbox_manager_sdk" ]
162eace7efcSopenharmony_ci    defines = [ "ABILITY_RUNTIME_FEATURE_SANDBOXMANAGER" ]
163eace7efcSopenharmony_ci  }
164eace7efcSopenharmony_ci
165eace7efcSopenharmony_ci  subsystem_name = "ability"
166eace7efcSopenharmony_ci  part_name = "ability_runtime"
167eace7efcSopenharmony_ci}
168