blob: b557deed23286f91d54f281f6303eca0436f7730 [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",
Jin Qiane4f1ec32017-08-15 16:26:53 -070027 "libbase",
Jin Qiane4f1ec32017-08-15 16:26:53 -070028 "libbinder",
29 "libcutils",
Yifan Hongbf2dcb22017-09-27 14:01:30 -070030 "libhidlbase",
Jin Qiane4f1ec32017-08-15 16:26:53 -070031 "liblog",
Jin Qianebf031b2017-08-14 16:41:24 -070032 "libprotobuf-cpp-lite",
Jin Qiane4f1ec32017-08-15 16:26:53 -070033 "libutils",
Jin Qianebf031b2017-08-14 16:41:24 -070034 "libz",
Samiul Islam26eeec72021-08-26 15:17:53 +010035 "packagemanager_aidl-cpp",
Jin Qiane4f1ec32017-08-15 16:26:53 -070036 ],
37
38 cflags: [
39 "-Wall",
40 "-Werror",
41 "-Wextra",
42 "-Wno-unused-parameter"
43 ],
44}
45
46cc_library_static {
47 name: "libstoraged",
48
49 defaults: ["storaged_defaults"],
50
Jin Qianb049d182017-10-12 17:02:17 -070051 aidl: {
52 export_aidl_headers: true,
53 local_include_dirs: ["binder"],
54 include_dirs: ["frameworks/native/aidl/binder"],
55 },
56
Jin Qiane4f1ec32017-08-15 16:26:53 -070057 srcs: [
58 "storaged.cpp",
Jin Qian65dea712017-08-29 16:48:20 -070059 "storaged_diskstats.cpp",
Jin Qiane4f1ec32017-08-15 16:26:53 -070060 "storaged_info.cpp",
61 "storaged_service.cpp",
62 "storaged_utils.cpp",
63 "storaged_uid_monitor.cpp",
Jin Qianb049d182017-10-12 17:02:17 -070064 "uid_info.cpp",
Jin Qianebf031b2017-08-14 16:41:24 -070065 "storaged.proto",
Colin Crossc2a3a202017-11-25 08:46:56 -080066 ":storaged_aidl",
Dan Willemsenc53f5c12018-09-14 21:27:31 -070067 ":storaged_aidl_private",
Jin Qiane4f1ec32017-08-15 16:26:53 -070068 ],
69
Yifan Hong70c44e72018-01-16 17:50:58 -080070 static_libs: ["libhealthhalutils"],
Yifan Hongacd2d302018-05-04 14:20:34 -070071 header_libs: ["libbatteryservice_headers"],
Yifan Hong70c44e72018-01-16 17:50:58 -080072
Jin Qiane4f1ec32017-08-15 16:26:53 -070073 logtags: ["EventLogTags.logtags"],
74
Jin Qianebf031b2017-08-14 16:41:24 -070075 proto: {
76 type: "lite",
77 export_proto_headers: true,
78 },
79
Jin Qiane4f1ec32017-08-15 16:26:53 -070080 export_include_dirs: ["include"],
81}
82
83cc_binary {
84 name: "storaged",
85
86 defaults: ["storaged_defaults"],
87
88 init_rc: ["storaged.rc"],
89
90 srcs: ["main.cpp"],
91
Yifan Hong70c44e72018-01-16 17:50:58 -080092 static_libs: [
93 "libhealthhalutils",
94 "libstoraged",
95 ],
Jin Qiane4f1ec32017-08-15 16:26:53 -070096}
97
98/*
99 * Run with:
100 * adb shell /data/nativetest/storaged-unit-tests/storaged-unit-tests
101 */
102cc_test {
103 name: "storaged-unit-tests",
104
105 defaults: ["storaged_defaults"],
106
107 srcs: ["tests/storaged_test.cpp"],
108
Yifan Hongc4b46e02018-01-16 15:49:08 -0800109 static_libs: [
110 "libhealthhalutils",
111 "libstoraged",
112 ],
Yifan Hongbf2dcb22017-09-27 14:01:30 -0700113}
Colin Crossc2a3a202017-11-25 08:46:56 -0800114
115// AIDL interface between storaged and framework.jar
116filegroup {
117 name: "storaged_aidl",
118 srcs: [
119 "binder/android/os/IStoraged.aidl",
120 ],
Dan Willemsenc53f5c12018-09-14 21:27:31 -0700121 path: "binder",
122}
123
124filegroup {
125 name: "storaged_aidl_private",
126 srcs: [
127 "binder/android/os/storaged/IStoragedPrivate.aidl",
128 ],
129 path: "binder",
Colin Crossc2a3a202017-11-25 08:46:56 -0800130}