# Copyright (c) 2022-2023 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//base/hiviewdfx/hiview/hiview.gni") import("//build/ohos.gni") if (enable_hiview_usage_event_report_build) { config("usage_event_report_config") { visibility = [ "*:*" ] include_dirs = [ "cache/include", "event/include", "include", ] if (power_manager_enable) { include_dirs += [ "idl/include" ] } } ohos_source_set("usage_event_report") { configs = [ ":usage_event_report_config" ] sources = [ "cache/event_db_helper.cpp", "cache/json_parser.cpp", "cache/usage_event_cacher.cpp", "event/sys_usage_event.cpp", "usage_event_report.cpp", ] if (power_manager_enable) { sources += [ "idl/hiview_shutdown_callback.cpp" ] } deps = [ "$hiview_base:hiviewbase", "//third_party/bounds_checking_function:libsec_shared", "//third_party/jsoncpp:jsoncpp", ] external_deps = [ "hilog:libhilog", "hisysevent:libhisysevent", "ipc:ipc_single", "relational_store:native_rdb", ] defines = [] if (power_manager_enable) { external_deps += [ "power_manager:powermgr_client" ] defines += [ "POWER_MANAGER_ENABLE" ] } part_name = "hiview" subsystem_name = "hiviewdfx" } } else { ohos_source_set("usage_event_report") { } } group("unittest") { testonly = true deps = [] } group("moduletest") { testonly = true deps = [] }