1# Copyright (c) 2021-2022 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/ohos.gni") 15import("//build/ohos/sa_profile/sa_profile.gni") 16import("//foundation/filemanagement/storage_service/storage_service_aafwk.gni") 17 18config("storage_manager_config") { 19 include_dirs = [ 20 "include", 21 "../../interfaces/innerkits/storage_manager/native", 22 "../storage_daemon/include", 23 "../common/include", 24 "${bundlemanager_framework_path}/services/bundlemgr/include", 25 "${multimedia_library_path}/frameworks/utils/include", 26 "${multimedia_library_path}/interfaces/inner_api/media_library_helper/include", 27 ] 28} 29 30ohos_shared_library("storage_manager") { 31 sources = [ 32 "ipc/src/storage_manager.cpp", 33 "ipc/src/storage_manager_stub.cpp", 34 "storage_daemon_communication/src/storage_daemon_communication.cpp", 35 "user/src/multi_user_manager_service.cpp", 36 "utils/src/storage_utils.cpp", 37 ] 38 39 defines = [ 40 "STORAGE_LOG_TAG = \"StorageManager\"", 41 "LOG_DOMAIN = 0xD004300", 42 ] 43 44 if (storage_service_user_crypto_manager) { 45 defines += [ "USER_CRYPTO_MANAGER" ] 46 sources += [ "crypto/filesystem_crypto.cpp" ] 47 } 48 49 if (storage_service_external_storage_manager) { 50 defines += [ "EXTERNAL_STORAGE_MANAGER" ] 51 sources += [ 52 "disk/src/disk_manager_service.cpp", 53 "volume/src/notification.cpp", 54 "volume/src/volume_manager_service.cpp", 55 ] 56 } 57 58 configs = [ ":storage_manager_config" ] 59 60 deps = [ "${storage_interface_path}/innerkits/storage_manager/native:storage_manager_sa_proxy" ] 61 62 external_deps = [ 63 "ability_base:base", 64 "ability_base:want", 65 "access_token:libaccesstoken_sdk", 66 "c_utils:utils", 67 "common_event_service:cesfwk_innerkits", 68 "hilog:libhilog", 69 "hitrace:hitrace_meter", 70 "ipc:ipc_core", 71 "safwk:system_ability_fwk", 72 "samgr:samgr_proxy", 73 ] 74 75 if (storage_service_storage_statistics_manager) { 76 defines += [ "STORAGE_STATISTICS_MANAGER" ] 77 sources += [ 78 "account_subscriber/account_subscriber.cpp", 79 "storage/src/storage_status_service.cpp", 80 "storage/src/storage_total_status_service.cpp", 81 "storage/src/volume_storage_status_service.cpp", 82 ] 83 external_deps += [ 84 "ability_runtime:abilitykit_native", 85 "ability_runtime:dataobs_manager", 86 "bundle_framework:appexecfwk_base", 87 "bundle_framework:appexecfwk_core", 88 "data_share:datashare_consumer", 89 "relational_store:native_rdb", 90 ] 91 92 if (storage_service_graphic) { 93 defines += [ "STORAGE_SERVICE_GRAPHIC" ] 94 external_deps += [ 95 "media_library:media_library", 96 "media_library:media_library_manager", 97 ] 98 } 99 } 100 101 subsystem_name = "filemanagement" 102 part_name = "storage_service" 103 install_enable = true 104} 105 106group("storage_manager_unit_test") { 107 testonly = true 108 deps = [ 109 "client/test:storage_manager_client_test", 110 "innerkits_impl/test:storage_manager_innerkits_test", 111 "ipc/test:storage_manager_ipc_test", 112 "storage_daemon_communication/test:storage_manager_communication_test", 113 "user/test:storage_manager_user_test", 114 ] 115 116 if (storage_service_user_crypto_manager) { 117 deps += [ "crypto/test:storage_manager_crypto_test" ] 118 } 119 120 if (storage_service_storage_statistics_manager) { 121 deps += [ "storage/test:storage_manager_storage_test" ] 122 } 123 124 if (storage_service_external_storage_manager) { 125 deps += [ 126 "disk/test:storage_manager_disk_test", 127 "volume/test:storage_manager_volume_test", 128 ] 129 } 130} 131