146f34cbfSopenharmony_ci# Copyright (c) 2021-2023 Huawei Device Co., Ltd.
246f34cbfSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
346f34cbfSopenharmony_ci# you may not use this file except in compliance with the License.
446f34cbfSopenharmony_ci# You may obtain a copy of the License at
546f34cbfSopenharmony_ci#
646f34cbfSopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
746f34cbfSopenharmony_ci#
846f34cbfSopenharmony_ci# Unless required by applicable law or agreed to in writing, software
946f34cbfSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
1046f34cbfSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1146f34cbfSopenharmony_ci# See the License for the specific language governing permissions and
1246f34cbfSopenharmony_ci# limitations under the License.
1346f34cbfSopenharmony_ci
1446f34cbfSopenharmony_ciimport("//build/ohos.gni")
1546f34cbfSopenharmony_ciimport("../../accessibility.gni")
1646f34cbfSopenharmony_ciimport("../../appgallery.gni")
1746f34cbfSopenharmony_ciimport("../../av_session.gni")
1846f34cbfSopenharmony_ciimport("../../bluetooth_part.gni")
1946f34cbfSopenharmony_ciimport("../../config.gni")
2046f34cbfSopenharmony_ci
2146f34cbfSopenharmony_cigroup("audio_policy_packages") {
2246f34cbfSopenharmony_ci  deps = [
2346f34cbfSopenharmony_ci    ":audio_affinity_config",
2446f34cbfSopenharmony_ci    ":audio_converter_config",
2546f34cbfSopenharmony_ci    ":audio_device_config",
2646f34cbfSopenharmony_ci    ":audio_interrupt_policy_config",
2746f34cbfSopenharmony_ci    ":audio_policy_service",
2846f34cbfSopenharmony_ci    ":audio_strategy_router",
2946f34cbfSopenharmony_ci    ":audio_usage_strategy",
3046f34cbfSopenharmony_ci    ":audio_volume_config",
3146f34cbfSopenharmony_ci    "safe_volume_notification:audio_safe_volume_notification_impl",
3246f34cbfSopenharmony_ci  ]
3346f34cbfSopenharmony_ci
3446f34cbfSopenharmony_ci  if (audio_framework_feature_dtmf_tone) {
3546f34cbfSopenharmony_ci    deps += [ ":audio_tone_dtmf_config" ]
3646f34cbfSopenharmony_ci  }
3746f34cbfSopenharmony_ci}
3846f34cbfSopenharmony_ci
3946f34cbfSopenharmony_ciconfig("audio_policy_public_config") {
4046f34cbfSopenharmony_ci  include_dirs = [
4146f34cbfSopenharmony_ci    "common/include",
4246f34cbfSopenharmony_ci    "client/include",
4346f34cbfSopenharmony_ci    "server/include",
4446f34cbfSopenharmony_ci    "server/include/service",
4546f34cbfSopenharmony_ci    "server/include/service/common",
4646f34cbfSopenharmony_ci    "server/include/service/config",
4746f34cbfSopenharmony_ci    "server/include/service/effect",
4846f34cbfSopenharmony_ci    "server/include/service/interface",
4946f34cbfSopenharmony_ci    "server/include/service/listener",
5046f34cbfSopenharmony_ci    "server/include/service/manager",
5146f34cbfSopenharmony_ci    "server/include/service/manager/pnp_server",
5246f34cbfSopenharmony_ci    "server/include/service/routers",
5346f34cbfSopenharmony_ci    "server/include/service/spatialization",
5446f34cbfSopenharmony_ci    "server/src/interface",
5546f34cbfSopenharmony_ci    "server/src/service/concurrency",
5646f34cbfSopenharmony_ci    "server/src/service/interrupt",
5746f34cbfSopenharmony_ci    "server/src/service/session",
5846f34cbfSopenharmony_ci    "safe_volume_notification/include",
5946f34cbfSopenharmony_ci    "../audio_service/client/include",
6046f34cbfSopenharmony_ci    "../audio_service/common/include",
6146f34cbfSopenharmony_ci    "../../frameworks/native/audioinnercall/include",
6246f34cbfSopenharmony_ci    "../../frameworks/native/audiorenderer/include",
6346f34cbfSopenharmony_ci    "../../frameworks/native/audioadapter/include",
6446f34cbfSopenharmony_ci    "../../frameworks/native/audiopolicy/include",
6546f34cbfSopenharmony_ci    "../../frameworks/native/audioutils/include",
6646f34cbfSopenharmony_ci    "../../frameworks/native/bluetoothclient",
6746f34cbfSopenharmony_ci    "../../interfaces/inner_api/native/audiocommon/include",
6846f34cbfSopenharmony_ci    "../../interfaces/inner_api/native/audiomanager/include",
6946f34cbfSopenharmony_ci  ]
7046f34cbfSopenharmony_ci
7146f34cbfSopenharmony_ci  cflags = [
7246f34cbfSopenharmony_ci    "-Wall",
7346f34cbfSopenharmony_ci    "-Werror",
7446f34cbfSopenharmony_ci  ]
7546f34cbfSopenharmony_ci
7646f34cbfSopenharmony_ci  if (target_cpu == "arm") {
7746f34cbfSopenharmony_ci    cflags += [ "-DBINDER_IPC_32BIT" ]
7846f34cbfSopenharmony_ci  }
7946f34cbfSopenharmony_ci
8046f34cbfSopenharmony_ci  if (accessibility_enable == true) {
8146f34cbfSopenharmony_ci    cflags += [ "-DACCESSIBILITY_ENABLE" ]
8246f34cbfSopenharmony_ci  }
8346f34cbfSopenharmony_ci
8446f34cbfSopenharmony_ci  if (bluetooth_part_enable == true) {
8546f34cbfSopenharmony_ci    cflags += [ "-DBLUETOOTH_ENABLE" ]
8646f34cbfSopenharmony_ci  }
8746f34cbfSopenharmony_ci
8846f34cbfSopenharmony_ci  if (avsession_part_enable == true) {
8946f34cbfSopenharmony_ci    cflags += [ "-DAVSESSION_ENABLE" ]
9046f34cbfSopenharmony_ci  }
9146f34cbfSopenharmony_ci
9246f34cbfSopenharmony_ci  ldflags = [ "-Wl" ]
9346f34cbfSopenharmony_ci}
9446f34cbfSopenharmony_ci
9546f34cbfSopenharmony_ciohos_shared_library("audio_setting_provider") {
9646f34cbfSopenharmony_ci  stack_protector_ret = true
9746f34cbfSopenharmony_ci  sanitize = {
9846f34cbfSopenharmony_ci    cfi = true
9946f34cbfSopenharmony_ci    cfi_cross_dso = true
10046f34cbfSopenharmony_ci    cfi_vcall_icall_only = true
10146f34cbfSopenharmony_ci    debug = false
10246f34cbfSopenharmony_ci  }
10346f34cbfSopenharmony_ci  install_enable = true
10446f34cbfSopenharmony_ci
10546f34cbfSopenharmony_ci  include_dirs = [
10646f34cbfSopenharmony_ci    "../../services/audio_policy/server/include/service/manager",
10746f34cbfSopenharmony_ci    "../../interfaces/inner_api/native/audiocommon/include",
10846f34cbfSopenharmony_ci  ]
10946f34cbfSopenharmony_ci
11046f34cbfSopenharmony_ci  sources = [ "server/src/service/manager/audio_setting_provider.cpp" ]
11146f34cbfSopenharmony_ci
11246f34cbfSopenharmony_ci  deps = [ "../../frameworks/native/audioutils:audio_utils" ]
11346f34cbfSopenharmony_ci
11446f34cbfSopenharmony_ci  external_deps = [
11546f34cbfSopenharmony_ci    "c_utils:utils",
11646f34cbfSopenharmony_ci    "data_share:datashare_common",
11746f34cbfSopenharmony_ci    "data_share:datashare_consumer",
11846f34cbfSopenharmony_ci    "hilog:libhilog",
11946f34cbfSopenharmony_ci    "ipc:ipc_single",
12046f34cbfSopenharmony_ci    "os_account:os_account_innerkits",
12146f34cbfSopenharmony_ci    "samgr:samgr_proxy",
12246f34cbfSopenharmony_ci  ]
12346f34cbfSopenharmony_ci
12446f34cbfSopenharmony_ci  defines = []
12546f34cbfSopenharmony_ci  if (audio_framework_feature_support_os_account) {
12646f34cbfSopenharmony_ci    defines += [ "SUPPORT_USER_ACCOUNT" ]
12746f34cbfSopenharmony_ci  }
12846f34cbfSopenharmony_ci
12946f34cbfSopenharmony_ci  part_name = "audio_framework"
13046f34cbfSopenharmony_ci  subsystem_name = "multimedia"
13146f34cbfSopenharmony_ci}
13246f34cbfSopenharmony_ci
13346f34cbfSopenharmony_ciohos_shared_library("audio_policy_service") {
13446f34cbfSopenharmony_ci  stack_protector_ret = true
13546f34cbfSopenharmony_ci  sanitize = {
13646f34cbfSopenharmony_ci    cfi = true
13746f34cbfSopenharmony_ci    cfi_cross_dso = true
13846f34cbfSopenharmony_ci    cfi_vcall_icall_only = true
13946f34cbfSopenharmony_ci    debug = false
14046f34cbfSopenharmony_ci  }
14146f34cbfSopenharmony_ci  install_enable = true
14246f34cbfSopenharmony_ci  sources = [
14346f34cbfSopenharmony_ci    "client/src/audio_interrupt_group_info.cpp",
14446f34cbfSopenharmony_ci    "client/src/audio_volume_group_info.cpp",
14546f34cbfSopenharmony_ci    "server/src/audio_anahs_manager_listener_proxy.cpp",
14646f34cbfSopenharmony_ci    "server/src/audio_client_tracker_callback_proxy.cpp",
14746f34cbfSopenharmony_ci    "server/src/audio_concurrency_state_listener_proxy.cpp",
14846f34cbfSopenharmony_ci    "server/src/audio_group_handle.cpp",
14946f34cbfSopenharmony_ci    "server/src/audio_policy_client_proxy.cpp",
15046f34cbfSopenharmony_ci    "server/src/audio_policy_manager_listener_proxy.cpp",
15146f34cbfSopenharmony_ci    "server/src/audio_policy_manager_stub.cpp",
15246f34cbfSopenharmony_ci    "server/src/audio_policy_server.cpp",
15346f34cbfSopenharmony_ci    "server/src/audio_policy_server_handler.cpp",
15446f34cbfSopenharmony_ci    "server/src/audio_routing_manager_listener_proxy.cpp",
15546f34cbfSopenharmony_ci    "server/src/audio_spatialization_state_change_listener_proxy.cpp",
15646f34cbfSopenharmony_ci    "server/src/audio_stream_collector.cpp",
15746f34cbfSopenharmony_ci    "server/src/service/audio_affinity_manager.cpp",
15846f34cbfSopenharmony_ci    "server/src/service/audio_device_manager.cpp",
15946f34cbfSopenharmony_ci    "server/src/service/audio_policy_service.cpp",
16046f34cbfSopenharmony_ci    "server/src/service/audio_state_manager.cpp",
16146f34cbfSopenharmony_ci    "server/src/service/concurrency/audio_concurrency_service.cpp",
16246f34cbfSopenharmony_ci    "server/src/service/config/audio_adapter_info.cpp",
16346f34cbfSopenharmony_ci    "server/src/service/config/audio_affinity_parser.cpp",
16446f34cbfSopenharmony_ci    "server/src/service/config/audio_concurrency_parser.cpp",
16546f34cbfSopenharmony_ci    "server/src/service/config/audio_converter_parser.cpp",
16646f34cbfSopenharmony_ci    "server/src/service/config/audio_device_parser.cpp",
16746f34cbfSopenharmony_ci    "server/src/service/config/audio_focus_parser.cpp",
16846f34cbfSopenharmony_ci    "server/src/service/config/audio_policy_parser.cpp",
16946f34cbfSopenharmony_ci    "server/src/service/config/audio_strategy_router_parser.cpp",
17046f34cbfSopenharmony_ci    "server/src/service/config/audio_usage_strategy_parser.cpp",
17146f34cbfSopenharmony_ci    "server/src/service/config/audio_volume_parser.cpp",
17246f34cbfSopenharmony_ci    "server/src/service/data_share_observer_callback.cpp",
17346f34cbfSopenharmony_ci    "server/src/service/device_init_callback.cpp",
17446f34cbfSopenharmony_ci    "server/src/service/effect/audio_effect_config_parser.cpp",
17546f34cbfSopenharmony_ci    "server/src/service/effect/audio_effect_manager.cpp",
17646f34cbfSopenharmony_ci    "server/src/service/interrupt/audio_interrupt_service.cpp",
17746f34cbfSopenharmony_ci    "server/src/service/listener/device_status_listener.cpp",
17846f34cbfSopenharmony_ci    "server/src/service/listener/power_state_listener.cpp",
17946f34cbfSopenharmony_ci    "server/src/service/manager/audio_adapter_manager.cpp",
18046f34cbfSopenharmony_ci    "server/src/service/manager/audio_adapter_manager_handler.cpp",
18146f34cbfSopenharmony_ci    "server/src/service/manager/client_type_manager.cpp",
18246f34cbfSopenharmony_ci    "server/src/service/manager/client_type_manager_handler.cpp",
18346f34cbfSopenharmony_ci    "server/src/service/manager/pnp_server/audio_input_thread.cpp",
18446f34cbfSopenharmony_ci    "server/src/service/manager/pnp_server/audio_pnp_server.cpp",
18546f34cbfSopenharmony_ci    "server/src/service/manager/pnp_server/audio_socket_thread.cpp",
18646f34cbfSopenharmony_ci    "server/src/service/manager/volume_data_maintainer.cpp",
18746f34cbfSopenharmony_ci    "server/src/service/routers/app_select_router.cpp",
18846f34cbfSopenharmony_ci    "server/src/service/routers/audio_router_center.cpp",
18946f34cbfSopenharmony_ci    "server/src/service/routers/cockpit_phone_router.cpp",
19046f34cbfSopenharmony_ci    "server/src/service/routers/default_router.cpp",
19146f34cbfSopenharmony_ci    "server/src/service/routers/package_filter_router.cpp",
19246f34cbfSopenharmony_ci    "server/src/service/routers/pair_device_router.cpp",
19346f34cbfSopenharmony_ci    "server/src/service/routers/privacy_priority_router.cpp",
19446f34cbfSopenharmony_ci    "server/src/service/routers/public_priority_router.cpp",
19546f34cbfSopenharmony_ci    "server/src/service/routers/stream_filter_router.cpp",
19646f34cbfSopenharmony_ci    "server/src/service/routers/user_select_router.cpp",
19746f34cbfSopenharmony_ci    "server/src/service/session/audio_session.cpp",
19846f34cbfSopenharmony_ci    "server/src/service/session/audio_session_service.cpp",
19946f34cbfSopenharmony_ci    "server/src/service/session/audio_session_timer.cpp",
20046f34cbfSopenharmony_ci    "server/src/service/spatialization/audio_spatialization_service.cpp",
20146f34cbfSopenharmony_ci  ]
20246f34cbfSopenharmony_ci
20346f34cbfSopenharmony_ci  defines = []
20446f34cbfSopenharmony_ci  if (audio_framework_feature_double_pnp_detect) {
20546f34cbfSopenharmony_ci    defines += [ "AUDIO_DOUBLE_PNP_DETECT" ]
20646f34cbfSopenharmony_ci  }
20746f34cbfSopenharmony_ci
20846f34cbfSopenharmony_ci  if (build_variant == "user") {
20946f34cbfSopenharmony_ci    defines += [ "AUDIO_BUILD_VARIANT_USER" ]
21046f34cbfSopenharmony_ci  } else if (build_variant == "root") {
21146f34cbfSopenharmony_ci    defines += [ "AUDIO_BUILD_VARIANT_ROOT" ]
21246f34cbfSopenharmony_ci  }
21346f34cbfSopenharmony_ci
21446f34cbfSopenharmony_ci  if (audio_framework_feature_support_os_account) {
21546f34cbfSopenharmony_ci    defines += [ "SUPPORT_USER_ACCOUNT" ]
21646f34cbfSopenharmony_ci  }
21746f34cbfSopenharmony_ci
21846f34cbfSopenharmony_ci  if (audio_framework_feature_dtmf_tone) {
21946f34cbfSopenharmony_ci    sources += [ "server/src/service/config/audio_tone_parser.cpp" ]
22046f34cbfSopenharmony_ci    defines += [ "FEATURE_DTMF_TONE" ]
22146f34cbfSopenharmony_ci  }
22246f34cbfSopenharmony_ci
22346f34cbfSopenharmony_ci  public_configs = [ ":audio_policy_public_config" ]
22446f34cbfSopenharmony_ci
22546f34cbfSopenharmony_ci  deps = [
22646f34cbfSopenharmony_ci    "../../frameworks/native/audioadapter:pulse_audio_service_adapter",
22746f34cbfSopenharmony_ci    "../../frameworks/native/audioinnercall:audio_inner_call",
22846f34cbfSopenharmony_ci    "../../frameworks/native/audioutils:audio_utils",
22946f34cbfSopenharmony_ci    "../audio_policy:audio_config.para",
23046f34cbfSopenharmony_ci    "../audio_policy:audio_config.para.dac",
23146f34cbfSopenharmony_ci    "../audio_policy:audio_setting_provider",
23246f34cbfSopenharmony_ci    "../audio_service:audio_client",
23346f34cbfSopenharmony_ci    "../audio_service:audio_common",
23446f34cbfSopenharmony_ci  ]
23546f34cbfSopenharmony_ci
23646f34cbfSopenharmony_ci  external_deps = [
23746f34cbfSopenharmony_ci    "ability_base:session_info",
23846f34cbfSopenharmony_ci    "ability_base:want",
23946f34cbfSopenharmony_ci    "ability_base:zuri",
24046f34cbfSopenharmony_ci    "ability_runtime:ability_connect_callback_stub",
24146f34cbfSopenharmony_ci    "ability_runtime:ability_context_native",
24246f34cbfSopenharmony_ci    "ability_runtime:app_context",
24346f34cbfSopenharmony_ci    "ability_runtime:dataobs_manager",
24446f34cbfSopenharmony_ci    "ability_runtime:extension_manager",
24546f34cbfSopenharmony_ci    "access_token:libaccesstoken_sdk",
24646f34cbfSopenharmony_ci    "access_token:libprivacy_sdk",
24746f34cbfSopenharmony_ci    "access_token:libtokenid_sdk",
24846f34cbfSopenharmony_ci    "access_token:libtokensetproc_shared",
24946f34cbfSopenharmony_ci    "bounds_checking_function:libsec_shared",
25046f34cbfSopenharmony_ci    "bundle_framework:appexecfwk_base",
25146f34cbfSopenharmony_ci    "bundle_framework:appexecfwk_core",
25246f34cbfSopenharmony_ci    "c_utils:utils",
25346f34cbfSopenharmony_ci    "data_share:datashare_common",
25446f34cbfSopenharmony_ci    "data_share:datashare_consumer",
25546f34cbfSopenharmony_ci    "drivers_interface_audio:libaudio_proxy_4.0",
25646f34cbfSopenharmony_ci    "eventhandler:libeventhandler",
25746f34cbfSopenharmony_ci    "hdf_core:libhdf_host",
25846f34cbfSopenharmony_ci    "hdf_core:libhdf_ipc_adapter",
25946f34cbfSopenharmony_ci    "hdf_core:libhdf_utils",
26046f34cbfSopenharmony_ci    "hdf_core:libhdi",
26146f34cbfSopenharmony_ci    "hdf_core:libpub_utils",
26246f34cbfSopenharmony_ci    "hilog:libhilog",
26346f34cbfSopenharmony_ci    "hisysevent:libhisysevent",
26446f34cbfSopenharmony_ci    "init:libbegetutil",
26546f34cbfSopenharmony_ci    "ipc:ipc_single",
26646f34cbfSopenharmony_ci    "kv_store:distributeddata_inner",
26746f34cbfSopenharmony_ci    "media_foundation:media_monitor_client",
26846f34cbfSopenharmony_ci    "media_foundation:media_monitor_common",
26946f34cbfSopenharmony_ci    "os_account:os_account_innerkits",
27046f34cbfSopenharmony_ci    "power_manager:power_setting",
27146f34cbfSopenharmony_ci    "power_manager:powermgr_client",
27246f34cbfSopenharmony_ci    "pulseaudio:pulse",
27346f34cbfSopenharmony_ci    "safwk:system_ability_fwk",
27446f34cbfSopenharmony_ci    "samgr:samgr_proxy",
27546f34cbfSopenharmony_ci  ]
27646f34cbfSopenharmony_ci
27746f34cbfSopenharmony_ci  public_external_deps = [
27846f34cbfSopenharmony_ci    "libxml2:libxml2",
27946f34cbfSopenharmony_ci    "openssl:libcrypto_shared",
28046f34cbfSopenharmony_ci  ]
28146f34cbfSopenharmony_ci
28246f34cbfSopenharmony_ci  if (audio_framework_config_policy_enable) {
28346f34cbfSopenharmony_ci    defines += [ "USE_CONFIG_POLICY" ]
28446f34cbfSopenharmony_ci    external_deps += [ "config_policy:configpolicy_util" ]
28546f34cbfSopenharmony_ci  }
28646f34cbfSopenharmony_ci
28746f34cbfSopenharmony_ci  if (appgallery_part_enable == true) {
28846f34cbfSopenharmony_ci    defines += [ "FEATURE_APPGALLERY" ]
28946f34cbfSopenharmony_ci  }
29046f34cbfSopenharmony_ci
29146f34cbfSopenharmony_ci  if (bluetooth_part_enable == true) {
29246f34cbfSopenharmony_ci    deps += [ "../../frameworks/native/bluetoothclient:audio_bluetooth_client" ]
29346f34cbfSopenharmony_ci    external_deps += [ "bluetooth:btframework" ]
29446f34cbfSopenharmony_ci  }
29546f34cbfSopenharmony_ci
29646f34cbfSopenharmony_ci  if (avsession_part_enable == true) {
29746f34cbfSopenharmony_ci    external_deps += [
29846f34cbfSopenharmony_ci      "ability_base:want",
29946f34cbfSopenharmony_ci      "ability_runtime:wantagent_innerkits",
30046f34cbfSopenharmony_ci      "av_session:avsession_client",
30146f34cbfSopenharmony_ci      "input:libmmi-client",
30246f34cbfSopenharmony_ci    ]
30346f34cbfSopenharmony_ci  }
30446f34cbfSopenharmony_ci
30546f34cbfSopenharmony_ci  if (audio_framework_feature_input) {
30646f34cbfSopenharmony_ci    defines += [ "FEATURE_MULTIMODALINPUT_INPUT" ]
30746f34cbfSopenharmony_ci    external_deps += [ "input:libmmi-client" ]
30846f34cbfSopenharmony_ci  }
30946f34cbfSopenharmony_ci
31046f34cbfSopenharmony_ci  if (audio_framework_feature_device_manager) {
31146f34cbfSopenharmony_ci    defines += [ "FEATURE_DEVICE_MANAGER" ]
31246f34cbfSopenharmony_ci    external_deps += [ "device_manager:devicemanagersdk" ]
31346f34cbfSopenharmony_ci  }
31446f34cbfSopenharmony_ci
31546f34cbfSopenharmony_ci  subsystem_name = "multimedia"
31646f34cbfSopenharmony_ci  part_name = "audio_framework"
31746f34cbfSopenharmony_ci}
31846f34cbfSopenharmony_ci
31946f34cbfSopenharmony_ciohos_prebuilt_etc("audio_interrupt_policy_config") {
32046f34cbfSopenharmony_ci  source = "server/config/audio_interrupt_policy_config.xml"
32146f34cbfSopenharmony_ci
32246f34cbfSopenharmony_ci  subsystem_name = "multimedia"
32346f34cbfSopenharmony_ci  relative_install_dir = "audio"
32446f34cbfSopenharmony_ci  part_name = "audio_framework"
32546f34cbfSopenharmony_ci}
32646f34cbfSopenharmony_ci
32746f34cbfSopenharmony_ciohos_prebuilt_etc("audio_strategy_router") {
32846f34cbfSopenharmony_ci  source = "server/config/audio_strategy_router.xml"
32946f34cbfSopenharmony_ci
33046f34cbfSopenharmony_ci  subsystem_name = "multimedia"
33146f34cbfSopenharmony_ci  relative_install_dir = "audio"
33246f34cbfSopenharmony_ci  part_name = "audio_framework"
33346f34cbfSopenharmony_ci}
33446f34cbfSopenharmony_ci
33546f34cbfSopenharmony_ciohos_prebuilt_etc("audio_usage_strategy") {
33646f34cbfSopenharmony_ci  source = "server/config/audio_usage_strategy.xml"
33746f34cbfSopenharmony_ci
33846f34cbfSopenharmony_ci  subsystem_name = "multimedia"
33946f34cbfSopenharmony_ci  relative_install_dir = "audio"
34046f34cbfSopenharmony_ci  part_name = "audio_framework"
34146f34cbfSopenharmony_ci}
34246f34cbfSopenharmony_ci
34346f34cbfSopenharmony_ciohos_prebuilt_etc("audio_device_config") {
34446f34cbfSopenharmony_ci  source = "server/config/audio_device_privacy.xml"
34546f34cbfSopenharmony_ci
34646f34cbfSopenharmony_ci  subsystem_name = "multimedia"
34746f34cbfSopenharmony_ci  relative_install_dir = "audio"
34846f34cbfSopenharmony_ci  part_name = "audio_framework"
34946f34cbfSopenharmony_ci}
35046f34cbfSopenharmony_ci
35146f34cbfSopenharmony_ciohos_prebuilt_etc("audio_volume_config") {
35246f34cbfSopenharmony_ci  source = "server/config/audio_volume_config.xml"
35346f34cbfSopenharmony_ci
35446f34cbfSopenharmony_ci  subsystem_name = "multimedia"
35546f34cbfSopenharmony_ci  relative_install_dir = "audio"
35646f34cbfSopenharmony_ci  part_name = "audio_framework"
35746f34cbfSopenharmony_ci}
35846f34cbfSopenharmony_ci
35946f34cbfSopenharmony_ciohos_prebuilt_etc("audio_affinity_config") {
36046f34cbfSopenharmony_ci  source = "server/config/audio_affinity_config.xml"
36146f34cbfSopenharmony_ci
36246f34cbfSopenharmony_ci  subsystem_name = "multimedia"
36346f34cbfSopenharmony_ci  relative_install_dir = "audio"
36446f34cbfSopenharmony_ci  part_name = "audio_framework"
36546f34cbfSopenharmony_ci}
36646f34cbfSopenharmony_ci
36746f34cbfSopenharmony_ciif (audio_framework_feature_dtmf_tone) {
36846f34cbfSopenharmony_ci  ohos_prebuilt_etc("audio_tone_dtmf_config") {
36946f34cbfSopenharmony_ci    source = "server/config/audio_tone_dtmf_config.xml"
37046f34cbfSopenharmony_ci
37146f34cbfSopenharmony_ci    subsystem_name = "multimedia"
37246f34cbfSopenharmony_ci    relative_install_dir = "audio"
37346f34cbfSopenharmony_ci    part_name = "audio_framework"
37446f34cbfSopenharmony_ci  }
37546f34cbfSopenharmony_ci}
37646f34cbfSopenharmony_ci
37746f34cbfSopenharmony_ciohos_prebuilt_etc("audio_converter_config") {
37846f34cbfSopenharmony_ci  source = "server/config/audio_converter_config.xml"
37946f34cbfSopenharmony_ci
38046f34cbfSopenharmony_ci  subsystem_name = "multimedia"
38146f34cbfSopenharmony_ci  relative_install_dir = "audio"
38246f34cbfSopenharmony_ci  part_name = "audio_framework"
38346f34cbfSopenharmony_ci}
38446f34cbfSopenharmony_ci
38546f34cbfSopenharmony_ciohos_prebuilt_etc("audio_config.para") {
38646f34cbfSopenharmony_ci  source = "etc/audio_config.para"
38746f34cbfSopenharmony_ci  subsystem_name = "multimedia"
38846f34cbfSopenharmony_ci  part_name = "audio_framework"
38946f34cbfSopenharmony_ci  module_install_dir = "etc/param"
39046f34cbfSopenharmony_ci}
39146f34cbfSopenharmony_ci
39246f34cbfSopenharmony_ciohos_prebuilt_etc("audio_config.para.dac") {
39346f34cbfSopenharmony_ci  source = "etc/audio_config.para.dac"
39446f34cbfSopenharmony_ci  subsystem_name = "multimedia"
39546f34cbfSopenharmony_ci  part_name = "audio_framework"
39646f34cbfSopenharmony_ci  module_install_dir = "etc/param"
39746f34cbfSopenharmony_ci}
39846f34cbfSopenharmony_ci
39946f34cbfSopenharmony_ciconfig("audio_policy_client_config") {
40046f34cbfSopenharmony_ci  include_dirs = [
40146f34cbfSopenharmony_ci    "client/include",
40246f34cbfSopenharmony_ci    "common/include",
40346f34cbfSopenharmony_ci    "server/include",
40446f34cbfSopenharmony_ci    "../audio_service/client/include",
40546f34cbfSopenharmony_ci    "../audio_service/common/include",
40646f34cbfSopenharmony_ci    "../../frameworks/native/audiopolicy/include",
40746f34cbfSopenharmony_ci    "../../interfaces/inner_api/native/audiocommon/include",
40846f34cbfSopenharmony_ci    "../../interfaces/inner_api/native/audiomanager/include",
40946f34cbfSopenharmony_ci  ]
41046f34cbfSopenharmony_ci
41146f34cbfSopenharmony_ci  cflags = [
41246f34cbfSopenharmony_ci    "-Wall",
41346f34cbfSopenharmony_ci    "-Werror",
41446f34cbfSopenharmony_ci  ]
41546f34cbfSopenharmony_ci
41646f34cbfSopenharmony_ci  if (target_cpu == "arm") {
41746f34cbfSopenharmony_ci    cflags += [ "-DBINDER_IPC_32BIT" ]
41846f34cbfSopenharmony_ci  }
41946f34cbfSopenharmony_ci}
42046f34cbfSopenharmony_ci
42146f34cbfSopenharmony_ciohos_shared_library("audio_policy_client") {
42246f34cbfSopenharmony_ci  branch_protector_ret = "pac_ret"
42346f34cbfSopenharmony_ci  install_enable = true
42446f34cbfSopenharmony_ci
42546f34cbfSopenharmony_ci  defines = []
42646f34cbfSopenharmony_ci  if (audio_framework_feature_dtmf_tone) {
42746f34cbfSopenharmony_ci    defines += [ "FEATURE_DTMF_TONE" ]
42846f34cbfSopenharmony_ci  }
42946f34cbfSopenharmony_ci
43046f34cbfSopenharmony_ci  sources = [
43146f34cbfSopenharmony_ci    "../audio_service/client/src/audio_device_descriptor.cpp",
43246f34cbfSopenharmony_ci    "../audio_service/client/src/microphone_descriptor.cpp",
43346f34cbfSopenharmony_ci    "client/src/audio_anahs_manager_listener_stub.cpp",
43446f34cbfSopenharmony_ci    "client/src/audio_client_tracker_callback_stub.cpp",
43546f34cbfSopenharmony_ci    "client/src/audio_concurrency_state_listener_stub.cpp",
43646f34cbfSopenharmony_ci    "client/src/audio_policy_client_stub.cpp",
43746f34cbfSopenharmony_ci    "client/src/audio_policy_client_stub_impl.cpp",
43846f34cbfSopenharmony_ci    "client/src/audio_policy_manager.cpp",
43946f34cbfSopenharmony_ci    "client/src/audio_policy_manager_listener_stub.cpp",
44046f34cbfSopenharmony_ci    "client/src/audio_routing_manager_listener_stub.cpp",
44146f34cbfSopenharmony_ci    "client/src/audio_spatialization_state_change_listener_stub.cpp",
44246f34cbfSopenharmony_ci    "client/src/audio_volume_group_info.cpp",
44346f34cbfSopenharmony_ci    "client/src/proxy/audio_policy_callback_proxy.cpp",
44446f34cbfSopenharmony_ci    "client/src/proxy/audio_policy_microphone_proxy.cpp",
44546f34cbfSopenharmony_ci    "client/src/proxy/audio_policy_proxy.cpp",
44646f34cbfSopenharmony_ci    "client/src/proxy/audio_policy_volume_proxy.cpp",
44746f34cbfSopenharmony_ci  ]
44846f34cbfSopenharmony_ci
44946f34cbfSopenharmony_ci  deps = [ "../../frameworks/native/audioutils:audio_utils" ]
45046f34cbfSopenharmony_ci
45146f34cbfSopenharmony_ci  public_configs = [ ":audio_policy_client_config" ]
45246f34cbfSopenharmony_ci
45346f34cbfSopenharmony_ci  include_dirs = [ "../../frameworks/native/audioutils/include" ]
45446f34cbfSopenharmony_ci
45546f34cbfSopenharmony_ci  external_deps = [
45646f34cbfSopenharmony_ci    "bounds_checking_function:libsec_shared",
45746f34cbfSopenharmony_ci    "c_utils:utils",
45846f34cbfSopenharmony_ci    "eventhandler:libeventhandler",
45946f34cbfSopenharmony_ci    "hilog:libhilog",
46046f34cbfSopenharmony_ci    "init:libbegetutil",
46146f34cbfSopenharmony_ci    "ipc:ipc_single",
46246f34cbfSopenharmony_ci    "samgr:samgr_proxy",
46346f34cbfSopenharmony_ci  ]
46446f34cbfSopenharmony_ci  subsystem_name = "multimedia"
46546f34cbfSopenharmony_ci  innerapi_tags = [ "platformsdk" ]
46646f34cbfSopenharmony_ci  part_name = "audio_framework"
46746f34cbfSopenharmony_ci
46846f34cbfSopenharmony_ci  ldflags = [ "-Wl,-Bsymbolic" ]
46946f34cbfSopenharmony_ci}
47046f34cbfSopenharmony_ci
47146f34cbfSopenharmony_cigroup("audio_policy_test_packages") {
47246f34cbfSopenharmony_ci  testonly = true
47346f34cbfSopenharmony_ci
47446f34cbfSopenharmony_ci  deps = [
47546f34cbfSopenharmony_ci    ":audio_dump_test",
47646f34cbfSopenharmony_ci    ":audio_policy_test",
47746f34cbfSopenharmony_ci    "test:audio_policy_unittest_packages",
47846f34cbfSopenharmony_ci  ]
47946f34cbfSopenharmony_ci}
48046f34cbfSopenharmony_ci
48146f34cbfSopenharmony_ciohos_executable("audio_dump_test") {
48246f34cbfSopenharmony_ci  install_enable = false
48346f34cbfSopenharmony_ci  sanitize = {
48446f34cbfSopenharmony_ci    cfi = true
48546f34cbfSopenharmony_ci    cfi_cross_dso = true
48646f34cbfSopenharmony_ci    cfi_vcall_icall_only = true
48746f34cbfSopenharmony_ci    debug = false
48846f34cbfSopenharmony_ci  }
48946f34cbfSopenharmony_ci  sources = [ "test/example/audio_dump_test.cpp" ]
49046f34cbfSopenharmony_ci
49146f34cbfSopenharmony_ci  configs = [ ":audio_policy_client_config" ]
49246f34cbfSopenharmony_ci
49346f34cbfSopenharmony_ci  deps = [
49446f34cbfSopenharmony_ci    "../audio_policy:audio_policy_client",
49546f34cbfSopenharmony_ci    "../audio_service:audio_client",
49646f34cbfSopenharmony_ci  ]
49746f34cbfSopenharmony_ci
49846f34cbfSopenharmony_ci  include_dirs = []
49946f34cbfSopenharmony_ci
50046f34cbfSopenharmony_ci  external_deps = [
50146f34cbfSopenharmony_ci    "bounds_checking_function:libsec_shared",
50246f34cbfSopenharmony_ci    "c_utils:utils",
50346f34cbfSopenharmony_ci    "hilog:libhilog",
50446f34cbfSopenharmony_ci    "ipc:ipc_single",
50546f34cbfSopenharmony_ci  ]
50646f34cbfSopenharmony_ci
50746f34cbfSopenharmony_ci  part_name = "audio_framework"
50846f34cbfSopenharmony_ci  subsystem_name = "multimedia"
50946f34cbfSopenharmony_ci}
51046f34cbfSopenharmony_ci
51146f34cbfSopenharmony_ciohos_executable("audio_policy_test") {
51246f34cbfSopenharmony_ci  install_enable = false
51346f34cbfSopenharmony_ci
51446f34cbfSopenharmony_ci  sources = [ "test/example/audio_policy_test.cpp" ]
51546f34cbfSopenharmony_ci
51646f34cbfSopenharmony_ci  configs = [ ":audio_policy_client_config" ]
51746f34cbfSopenharmony_ci
51846f34cbfSopenharmony_ci  deps = [
51946f34cbfSopenharmony_ci    "../audio_policy:audio_policy_client",
52046f34cbfSopenharmony_ci    "../audio_service:audio_client",
52146f34cbfSopenharmony_ci  ]
52246f34cbfSopenharmony_ci
52346f34cbfSopenharmony_ci  include_dirs = []
52446f34cbfSopenharmony_ci
52546f34cbfSopenharmony_ci  external_deps = [
52646f34cbfSopenharmony_ci    "bounds_checking_function:libsec_shared",
52746f34cbfSopenharmony_ci    "c_utils:utils",
52846f34cbfSopenharmony_ci    "hilog:libhilog",
52946f34cbfSopenharmony_ci    "ipc:ipc_single",
53046f34cbfSopenharmony_ci  ]
53146f34cbfSopenharmony_ci
53246f34cbfSopenharmony_ci  part_name = "audio_framework"
53346f34cbfSopenharmony_ci  subsystem_name = "multimedia"
53446f34cbfSopenharmony_ci}
535