1# Copyright (c) 2024-2025 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14import("//build/config/features.gni") 15import("../../../../access_token.gni") 16 17privacy_include_dirs = [ 18 "${access_token_path}/frameworks/accesstoken/include", 19 "${access_token_path}/frameworks/privacy/include", 20 "${access_token_path}/frameworks/common/include", 21 "${access_token_path}/interfaces/innerkits/accesstoken/include", 22 "${access_token_path}/interfaces/innerkits/privacy/include", 23 "${access_token_path}/interfaces/innerkits/privacy/src", 24 "${access_token_path}/interfaces/innerkits/proxy_death/include", 25 "${access_token_path}/services/privacymanager/include/active", 26 "${access_token_path}/services/privacymanager/include/common", 27 "${access_token_path}/services/privacymanager/include/database", 28 "${access_token_path}/services/privacymanager/include/record", 29 "${access_token_path}/services/privacymanager/include/service", 30 "${access_token_path}/services/privacymanager/include/proxy", 31 "${access_token_path}/services/privacymanager/include/sensitive", 32 "${access_token_path}/services/privacymanager/include/sensitive/audio_manager/", 33 "${access_token_path}/services/privacymanager/include/sensitive/camera_manager/", 34 "${access_token_path}/services/common/app_manager/include", 35 "${access_token_path}/services/common/json_parse/include", 36 "${access_token_path}/services/common/database/include", 37 "${access_token_path}/services/common/libraryloader/include", 38 "${access_token_path}/services/common/screenlock_manager/include", 39 "${access_token_path}/services/common/utils/include", 40 "${access_token_path}/test/fuzztest/common", 41 "${access_token_path}/services/accesstokenmanager/main/cpp/include/permission", 42] 43 44privacy_deps = [ 45 "${access_token_path}/frameworks/common:accesstoken_common_cxx", 46 "${access_token_path}/frameworks/privacy:privacy_communication_adapter_cxx", 47 "${access_token_path}/interfaces/innerkits/accesstoken:libaccesstoken_sdk", 48 "${access_token_path}/interfaces/innerkits/accesstoken:libtokenid_sdk", 49 "${access_token_path}/interfaces/innerkits/token_setproc:libtokensetproc_shared", 50 "${access_token_path}/services/common:accesstoken_service_common", 51 "${access_token_path}/services/common/proxy_death:proxy_death_handler", 52 "${access_token_path}/services/privacymanager:privacy_manager_stub", 53] 54 55privacy_external_deps = [ 56 "ability_base:want", 57 "c_utils:utils", 58 "hilog:libhilog", 59 "hisysevent:libhisysevent", 60 "init:libbegetutil", 61 "ipc:ipc_core", 62 "safwk:system_ability_fwk", 63 "samgr:samgr_proxy", 64 "sqlite:sqlite", 65] 66 67privacy_sources = [ 68 "${access_token_path}/services/common/app_manager/src/app_manager_access_client.cpp", 69 "${access_token_path}/services/common/app_manager/src/app_state_data.cpp", 70 "${access_token_path}/services/common/app_manager/src/app_status_change_callback.cpp", 71 "${access_token_path}/services/common/app_manager/src/process_data.cpp", 72 "${access_token_path}/services/common/libraryloader/src/libraryloader.cpp", 73 "${access_token_path}/services/privacymanager/src/active/active_status_callback_manager.cpp", 74 "${access_token_path}/services/privacymanager/src/active/perm_active_status_callback_death_recipient.cpp", 75 "${access_token_path}/services/privacymanager/src/active/perm_active_status_change_callback_proxy.cpp", 76 "${access_token_path}/services/privacymanager/src/active/state_change_callback_proxy.cpp", 77 "${access_token_path}/services/privacymanager/src/common/access_token_helper.cpp", 78 "${access_token_path}/services/privacymanager/src/common/constant.cpp", 79 "${access_token_path}/services/privacymanager/src/database/data_translator.cpp", 80 "${access_token_path}/services/privacymanager/src/database/permission_used_record_db.cpp", 81 "${access_token_path}/services/privacymanager/src/database/privacy_field_const.cpp", 82 "${access_token_path}/services/privacymanager/src/proxy/privacy_manager_proxy_death_param.cpp", 83 "${access_token_path}/services/privacymanager/src/record/on_permission_used_record_callback_proxy.cpp", 84 "${access_token_path}/services/privacymanager/src/record/permission_record.cpp", 85 "${access_token_path}/services/privacymanager/src/record/permission_record_manager.cpp", 86 "${access_token_path}/services/privacymanager/src/record/permission_record_set.cpp", 87 "${access_token_path}/services/privacymanager/src/sensitive/audio_manager/audio_manager_adapter.cpp", 88 "${access_token_path}/services/privacymanager/src/sensitive/camera_manager/camera_manager_adapter.cpp", 89 "${access_token_path}/services/privacymanager/src/service/privacy_manager_service.cpp", 90] 91 92privacy_cflags_cc = [ 93 "-DHILOG_ENABLE", 94 "-DFUZZ_ENABLE", 95] 96 97privacy_defines = [] 98 99if (use_musl) { 100 if (musl_use_jemalloc && musl_use_jemalloc_dfx_intf) { 101 privacy_defines += [ "CONFIG_USE_JEMALLOC_DFX_INTF" ] 102 } 103} 104 105if (common_event_service_enable) { 106 privacy_cflags_cc += [ "-DCOMMON_EVENT_SERVICE_ENABLE" ] 107 privacy_external_deps += [ "common_event_service:cesfwk_innerkits" ] 108 privacy_sources += [ "${access_token_path}/services/privacymanager/src/common/privacy_common_event_subscriber.cpp" ] 109} 110 111if (theme_screenlock_mgr_enable) { 112 privacy_cflags_cc += [ "-DTHEME_SCREENLOCK_MGR_ENABLE" ] 113 privacy_external_deps += [ "screenlock_mgr:screenlock_client" ] 114} 115 116if (eventhandler_enable == true) { 117 privacy_cflags_cc += [ "-DEVENTHANDLER_ENABLE" ] 118 privacy_external_deps += [ "eventhandler:libeventhandler" ] 119} 120 121if (access_token_app_security_privacy_service_enable) { 122 privacy_cflags_cc += [ "-DAPP_SECURITY_PRIVACY_SERVICE" ] 123} else { 124 privacy_include_dirs += 125 [ "${access_token_path}/services/common/ability_manager/include" ] 126} 127 128if (audio_framework_enable) { 129 privacy_cflags_cc += [ "-DAUDIO_FRAMEWORK_ENABLE" ] 130 privacy_external_deps += [ "audio_framework:audio_client" ] 131} 132 133if (camera_framework_enable) { 134 privacy_cflags_cc += [ "-DCAMERA_FRAMEWORK_ENABLE" ] 135 privacy_external_deps += [ "camera_framework:camera_framework" ] 136} 137