17859cbb8Sopenharmony_ci# Copyright (C) 2021-2022 Huawei Device Co., Ltd.
27859cbb8Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
37859cbb8Sopenharmony_ci# you may not use this file except in compliance with the License.
47859cbb8Sopenharmony_ci# You may obtain a copy of the License at
57859cbb8Sopenharmony_ci#
67859cbb8Sopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
77859cbb8Sopenharmony_ci#
87859cbb8Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software
97859cbb8Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
107859cbb8Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
117859cbb8Sopenharmony_ci# See the License for the specific language governing permissions and
127859cbb8Sopenharmony_ci# limitations under the License.
137859cbb8Sopenharmony_ciimport("//build/config/components/idl_tool/idl.gni")
147859cbb8Sopenharmony_ciimport("//build/ohos.gni")
157859cbb8Sopenharmony_ciimport("../../../core_service/telephony_core_service.gni")
167859cbb8Sopenharmony_ci
177859cbb8Sopenharmony_ciSUBSYSTEM_DIR = "../../../"
187859cbb8Sopenharmony_ciTELEPHONY_CORE_SERVICE_ROOT = "$SUBSYSTEM_DIR/core_service"
197859cbb8Sopenharmony_ciTELEPHONY_INTERFACES_INNERKITS =
207859cbb8Sopenharmony_ci    "$TELEPHONY_CORE_SERVICE_ROOT/interfaces/innerkits"
217859cbb8Sopenharmony_ciTELEPHONY_FRAMEWORKS_NATIVE_ROOT =
227859cbb8Sopenharmony_ci    "$TELEPHONY_CORE_SERVICE_ROOT/frameworks/native/"
237859cbb8Sopenharmony_ciTELEPHONY_IMS_CORE_SERVICE_ROOT =
247859cbb8Sopenharmony_ci    "$TELEPHONY_CORE_SERVICE_ROOT/services/ims_service_interaction"
257859cbb8Sopenharmony_ci
267859cbb8Sopenharmony_ciconfig("tel_core_service_api_config") {
277859cbb8Sopenharmony_ci  # header file path
287859cbb8Sopenharmony_ci  include_dirs = [
297859cbb8Sopenharmony_ci    "$TELEPHONY_INTERFACES_INNERKITS/include",
307859cbb8Sopenharmony_ci    "$TELEPHONY_INTERFACES_INNERKITS/ims/include",
317859cbb8Sopenharmony_ci    "$TELEPHONY_INTERFACES_INNERKITS/satellite",
327859cbb8Sopenharmony_ci  ]
337859cbb8Sopenharmony_ci  if (core_service_support_esim) {
347859cbb8Sopenharmony_ci    include_dirs += [ "${target_gen_dir}" ]
357859cbb8Sopenharmony_ci  }
367859cbb8Sopenharmony_ci
377859cbb8Sopenharmony_ci  cflags = []
387859cbb8Sopenharmony_ci  if (is_double_framework) {
397859cbb8Sopenharmony_ci    cflags = [ "-DCONFIG_DUAL_FRAMEWORK" ]
407859cbb8Sopenharmony_ci  }
417859cbb8Sopenharmony_ci  if (target_cpu == "arm") {
427859cbb8Sopenharmony_ci    cflags += [ "-DBINDER_IPC_32BIT" ]
437859cbb8Sopenharmony_ci  }
447859cbb8Sopenharmony_ci  if (is_standard_system) {
457859cbb8Sopenharmony_ci    cflags += [ "-DCONFIG_STANDARD_SYSTEM" ]
467859cbb8Sopenharmony_ci  }
477859cbb8Sopenharmony_ci  if (defined(build_public_version) && build_public_version) {
487859cbb8Sopenharmony_ci    cflags += [ "-DBUILD_PUBLIC_VERSION" ]
497859cbb8Sopenharmony_ci  }
507859cbb8Sopenharmony_ci}
517859cbb8Sopenharmony_ci
527859cbb8Sopenharmony_ciif (core_service_support_esim) {
537859cbb8Sopenharmony_ci  idl_interface_sources = [ "${target_gen_dir}/esim_service_proxy.cpp" ]
547859cbb8Sopenharmony_ci
557859cbb8Sopenharmony_ci  idl_gen_interface("esim_service_api") {
567859cbb8Sopenharmony_ci    src_idl = rebase_path("IEsimService.idl")
577859cbb8Sopenharmony_ci    dst_file = string_join(",", idl_interface_sources)
587859cbb8Sopenharmony_ci    log_domainid = "0xD001F04"
597859cbb8Sopenharmony_ci    log_tag = "CoreServiceApi"
607859cbb8Sopenharmony_ci  }
617859cbb8Sopenharmony_ci}
627859cbb8Sopenharmony_ci
637859cbb8Sopenharmony_ciohos_shared_library("tel_core_service_api") {
647859cbb8Sopenharmony_ci  sanitize = {
657859cbb8Sopenharmony_ci    cfi = true
667859cbb8Sopenharmony_ci    cfi_cross_dso = true
677859cbb8Sopenharmony_ci    debug = false
687859cbb8Sopenharmony_ci  }
697859cbb8Sopenharmony_ci  branch_protector_ret = "pac_ret"
707859cbb8Sopenharmony_ci  sources = [
717859cbb8Sopenharmony_ci    "$TELEPHONY_FRAMEWORKS_NATIVE_ROOT/src/cell_information.cpp",
727859cbb8Sopenharmony_ci    "$TELEPHONY_FRAMEWORKS_NATIVE_ROOT/src/cell_location.cpp",
737859cbb8Sopenharmony_ci    "$TELEPHONY_FRAMEWORKS_NATIVE_ROOT/src/core_manager_inner.cpp",
747859cbb8Sopenharmony_ci    "$TELEPHONY_FRAMEWORKS_NATIVE_ROOT/src/core_service_client.cpp",
757859cbb8Sopenharmony_ci    "$TELEPHONY_FRAMEWORKS_NATIVE_ROOT/src/core_service_proxy.cpp",
767859cbb8Sopenharmony_ci    "$TELEPHONY_FRAMEWORKS_NATIVE_ROOT/src/i_network_search_callback_stub.cpp",
777859cbb8Sopenharmony_ci    "$TELEPHONY_FRAMEWORKS_NATIVE_ROOT/src/ims_reg_info_callback_stub.cpp",
787859cbb8Sopenharmony_ci    "$TELEPHONY_FRAMEWORKS_NATIVE_ROOT/src/network_information.cpp",
797859cbb8Sopenharmony_ci    "$TELEPHONY_FRAMEWORKS_NATIVE_ROOT/src/network_search_result.cpp",
807859cbb8Sopenharmony_ci    "$TELEPHONY_FRAMEWORKS_NATIVE_ROOT/src/network_state.cpp",
817859cbb8Sopenharmony_ci    "$TELEPHONY_FRAMEWORKS_NATIVE_ROOT/src/nr_ssb_information.cpp",
827859cbb8Sopenharmony_ci    "$TELEPHONY_FRAMEWORKS_NATIVE_ROOT/src/operator_config_types.cpp",
837859cbb8Sopenharmony_ci    "$TELEPHONY_FRAMEWORKS_NATIVE_ROOT/src/resource_utils.cpp",
847859cbb8Sopenharmony_ci    "$TELEPHONY_FRAMEWORKS_NATIVE_ROOT/src/signal_information.cpp",
857859cbb8Sopenharmony_ci    "$TELEPHONY_FRAMEWORKS_NATIVE_ROOT/src/tel_ril_base_parcel.cpp",
867859cbb8Sopenharmony_ci    "$TELEPHONY_FRAMEWORKS_NATIVE_ROOT/src/telephony_state_registry_client.cpp",
877859cbb8Sopenharmony_ci    "$TELEPHONY_FRAMEWORKS_NATIVE_ROOT/src/telephony_state_registry_proxy.cpp",
887859cbb8Sopenharmony_ci    "$TELEPHONY_IMS_CORE_SERVICE_ROOT/src/ims_core_service_callback_proxy.cpp",
897859cbb8Sopenharmony_ci  ]
907859cbb8Sopenharmony_ci
917859cbb8Sopenharmony_ci  if (core_service_support_esim) {
927859cbb8Sopenharmony_ci    sources += [
937859cbb8Sopenharmony_ci      "$TELEPHONY_FRAMEWORKS_NATIVE_ROOT/src/download_profile_config_info_parcel.cpp",
947859cbb8Sopenharmony_ci      "$TELEPHONY_FRAMEWORKS_NATIVE_ROOT/src/download_profile_result_parcel.cpp",
957859cbb8Sopenharmony_ci      "$TELEPHONY_FRAMEWORKS_NATIVE_ROOT/src/downloadable_profile_parcel.cpp",
967859cbb8Sopenharmony_ci      "$TELEPHONY_FRAMEWORKS_NATIVE_ROOT/src/esim_service_client.cpp",
977859cbb8Sopenharmony_ci      "$TELEPHONY_FRAMEWORKS_NATIVE_ROOT/src/euicc_info_parcel.cpp",
987859cbb8Sopenharmony_ci      "$TELEPHONY_FRAMEWORKS_NATIVE_ROOT/src/get_downloadable_profiles_result_parcel.cpp",
997859cbb8Sopenharmony_ci      "$TELEPHONY_FRAMEWORKS_NATIVE_ROOT/src/profile_info_list_parcel.cpp",
1007859cbb8Sopenharmony_ci      "$TELEPHONY_FRAMEWORKS_NATIVE_ROOT/src/profile_metadata_result_parcel.cpp",
1017859cbb8Sopenharmony_ci      "$TELEPHONY_FRAMEWORKS_NATIVE_ROOT/src/response_esim_result.cpp",
1027859cbb8Sopenharmony_ci      "${target_gen_dir}/esim_service_proxy.cpp",
1037859cbb8Sopenharmony_ci    ]
1047859cbb8Sopenharmony_ci  }
1057859cbb8Sopenharmony_ci
1067859cbb8Sopenharmony_ci  version_script =
1077859cbb8Sopenharmony_ci      "$TELEPHONY_INTERFACES_INNERKITS/libtel_core_service_api.versionscript"
1087859cbb8Sopenharmony_ci
1097859cbb8Sopenharmony_ci  defines = [
1107859cbb8Sopenharmony_ci    "TELEPHONY_LOG_TAG = \"CoreServiceApi\"",
1117859cbb8Sopenharmony_ci    "LOG_DOMAIN = 0xD001F04",
1127859cbb8Sopenharmony_ci  ]
1137859cbb8Sopenharmony_ci
1147859cbb8Sopenharmony_ci  defines += telephony_extra_defines
1157859cbb8Sopenharmony_ci
1167859cbb8Sopenharmony_ci  public_configs = [ "$TELEPHONY_CORE_SERVICE_ROOT/utils:telephony_log_config" ]
1177859cbb8Sopenharmony_ci
1187859cbb8Sopenharmony_ci  public_configs += [ ":tel_core_service_api_config" ]
1197859cbb8Sopenharmony_ci
1207859cbb8Sopenharmony_ci  if (core_service_support_esim) {
1217859cbb8Sopenharmony_ci    deps = [ ":esim_service_api" ]
1227859cbb8Sopenharmony_ci  }
1237859cbb8Sopenharmony_ci
1247859cbb8Sopenharmony_ci  external_deps = [
1257859cbb8Sopenharmony_ci    "ability_base:want",
1267859cbb8Sopenharmony_ci    "bundle_framework:appexecfwk_base",
1277859cbb8Sopenharmony_ci    "bundle_framework:appexecfwk_core",
1287859cbb8Sopenharmony_ci    "c_utils:utils",
1297859cbb8Sopenharmony_ci    "eventhandler:libeventhandler",
1307859cbb8Sopenharmony_ci    "hilog:libhilog",
1317859cbb8Sopenharmony_ci    "init:libbegetutil",
1327859cbb8Sopenharmony_ci    "ipc:ipc_single",
1337859cbb8Sopenharmony_ci    "resource_management:global_resmgr",
1347859cbb8Sopenharmony_ci    "samgr:samgr_proxy",
1357859cbb8Sopenharmony_ci  ]
1367859cbb8Sopenharmony_ci
1377859cbb8Sopenharmony_ci  if (core_service_support_esim) {
1387859cbb8Sopenharmony_ci    external_deps += [ "ipc:ipc_core" ]
1397859cbb8Sopenharmony_ci  }
1407859cbb8Sopenharmony_ci
1417859cbb8Sopenharmony_ci  cflags_cc = [
1427859cbb8Sopenharmony_ci    "-O2",
1437859cbb8Sopenharmony_ci    "-D_FORTIFY_SOURCE=2",
1447859cbb8Sopenharmony_ci  ]
1457859cbb8Sopenharmony_ci
1467859cbb8Sopenharmony_ci  innerapi_tags = [ "platformsdk" ]
1477859cbb8Sopenharmony_ci  part_name = "core_service"
1487859cbb8Sopenharmony_ci  subsystem_name = "telephony"
1497859cbb8Sopenharmony_ci}
150