blob: 7960af3149a1edf4df04ab603952625aa26a2756 [file] [log] [blame]
Jin Qiane4f1ec32017-08-15 16:26:53 -07001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Bob Badourd69ad692021-02-16 19:02:14 -080017package {
18 default_applicable_licenses: ["Android-Apache-2.0"],
19}
20
Jin Qiane4f1ec32017-08-15 16:26:53 -070021cc_defaults {
22 name: "storaged_defaults",
23
24 shared_libs: [
Yifan Hongbf2dcb22017-09-27 14:01:30 -070025 "android.hardware.health@1.0",
26 "android.hardware.health@2.0",
Yifan Hong5291a672021-12-06 14:29:40 -080027 "android.hardware.health-V1-ndk",
Jin Qiane4f1ec32017-08-15 16:26:53 -070028 "libbase",
Jin Qiane4f1ec32017-08-15 16:26:53 -070029 "libbinder",
Yifan Hong5291a672021-12-06 14:29:40 -080030 "libbinder_ndk",
Jin Qiane4f1ec32017-08-15 16:26:53 -070031 "libcutils",
Yifan Hongbf2dcb22017-09-27 14:01:30 -070032 "libhidlbase",
Jin Qiane4f1ec32017-08-15 16:26:53 -070033 "liblog",
Jin Qianebf031b2017-08-14 16:41:24 -070034 "libprotobuf-cpp-lite",
Jin Qiane4f1ec32017-08-15 16:26:53 -070035 "libutils",
Jin Qianebf031b2017-08-14 16:41:24 -070036 "libz",
Samiul Islam26eeec72021-08-26 15:17:53 +010037 "packagemanager_aidl-cpp",
Jin Qiane4f1ec32017-08-15 16:26:53 -070038 ],
39
Yifan Hong5291a672021-12-06 14:29:40 -080040 static_libs: [
41 "android.hardware.health-translate-ndk",
42 "libhealthhalutils",
43 "libhealthshim",
44 ],
45
Jin Qiane4f1ec32017-08-15 16:26:53 -070046 cflags: [
47 "-Wall",
48 "-Werror",
49 "-Wextra",
50 "-Wno-unused-parameter"
51 ],
52}
53
54cc_library_static {
55 name: "libstoraged",
56
57 defaults: ["storaged_defaults"],
58
Jin Qianb049d182017-10-12 17:02:17 -070059 aidl: {
60 export_aidl_headers: true,
61 local_include_dirs: ["binder"],
62 include_dirs: ["frameworks/native/aidl/binder"],
63 },
64
Jin Qiane4f1ec32017-08-15 16:26:53 -070065 srcs: [
66 "storaged.cpp",
Jin Qian65dea712017-08-29 16:48:20 -070067 "storaged_diskstats.cpp",
Jin Qiane4f1ec32017-08-15 16:26:53 -070068 "storaged_info.cpp",
69 "storaged_service.cpp",
70 "storaged_utils.cpp",
71 "storaged_uid_monitor.cpp",
Jin Qianb049d182017-10-12 17:02:17 -070072 "uid_info.cpp",
Jin Qianebf031b2017-08-14 16:41:24 -070073 "storaged.proto",
Colin Crossc2a3a202017-11-25 08:46:56 -080074 ":storaged_aidl",
Dan Willemsenc53f5c12018-09-14 21:27:31 -070075 ":storaged_aidl_private",
Jin Qiane4f1ec32017-08-15 16:26:53 -070076 ],
77
Yifan Hongacd2d302018-05-04 14:20:34 -070078 header_libs: ["libbatteryservice_headers"],
Yifan Hong70c44e72018-01-16 17:50:58 -080079
Jin Qiane4f1ec32017-08-15 16:26:53 -070080 logtags: ["EventLogTags.logtags"],
81
Jin Qianebf031b2017-08-14 16:41:24 -070082 proto: {
83 type: "lite",
84 export_proto_headers: true,
85 },
86
Jin Qiane4f1ec32017-08-15 16:26:53 -070087 export_include_dirs: ["include"],
88}
89
90cc_binary {
91 name: "storaged",
92
93 defaults: ["storaged_defaults"],
94
95 init_rc: ["storaged.rc"],
96
97 srcs: ["main.cpp"],
98
Yifan Hong70c44e72018-01-16 17:50:58 -080099 static_libs: [
Yifan Hong70c44e72018-01-16 17:50:58 -0800100 "libstoraged",
101 ],
Jin Qiane4f1ec32017-08-15 16:26:53 -0700102}
103
104/*
105 * Run with:
106 * adb shell /data/nativetest/storaged-unit-tests/storaged-unit-tests
107 */
108cc_test {
109 name: "storaged-unit-tests",
110
111 defaults: ["storaged_defaults"],
112
113 srcs: ["tests/storaged_test.cpp"],
114
Yifan Hongc4b46e02018-01-16 15:49:08 -0800115 static_libs: [
Yifan Hongc4b46e02018-01-16 15:49:08 -0800116 "libstoraged",
117 ],
Yifan Hong1407fd02021-12-06 23:04:12 -0800118 test_suites: [
119 "general-tests",
120 ],
Yifan Hongbf2dcb22017-09-27 14:01:30 -0700121}
Colin Crossc2a3a202017-11-25 08:46:56 -0800122
123// AIDL interface between storaged and framework.jar
124filegroup {
125 name: "storaged_aidl",
126 srcs: [
127 "binder/android/os/IStoraged.aidl",
128 ],
Dan Willemsenc53f5c12018-09-14 21:27:31 -0700129 path: "binder",
130}
131
132filegroup {
133 name: "storaged_aidl_private",
134 srcs: [
135 "binder/android/os/storaged/IStoragedPrivate.aidl",
136 ],
137 path: "binder",
Colin Crossc2a3a202017-11-25 08:46:56 -0800138}