blob: 9d5cb482a68850f47ce8a5aecc22bb816d921c07 [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",
Jin Qiane4f1ec32017-08-15 16:26:53 -070035 ],
36
37 cflags: [
38 "-Wall",
39 "-Werror",
40 "-Wextra",
41 "-Wno-unused-parameter"
42 ],
43}
44
45cc_library_static {
46 name: "libstoraged",
47
48 defaults: ["storaged_defaults"],
49
Jin Qianb049d182017-10-12 17:02:17 -070050 aidl: {
51 export_aidl_headers: true,
52 local_include_dirs: ["binder"],
53 include_dirs: ["frameworks/native/aidl/binder"],
54 },
55
Jin Qiane4f1ec32017-08-15 16:26:53 -070056 srcs: [
57 "storaged.cpp",
Jin Qian65dea712017-08-29 16:48:20 -070058 "storaged_diskstats.cpp",
Jin Qiane4f1ec32017-08-15 16:26:53 -070059 "storaged_info.cpp",
60 "storaged_service.cpp",
61 "storaged_utils.cpp",
62 "storaged_uid_monitor.cpp",
Jin Qianb049d182017-10-12 17:02:17 -070063 "uid_info.cpp",
Jin Qianebf031b2017-08-14 16:41:24 -070064 "storaged.proto",
Colin Crossc2a3a202017-11-25 08:46:56 -080065 ":storaged_aidl",
Dan Willemsenc53f5c12018-09-14 21:27:31 -070066 ":storaged_aidl_private",
Jin Qiane4f1ec32017-08-15 16:26:53 -070067 ],
68
Yifan Hong70c44e72018-01-16 17:50:58 -080069 static_libs: ["libhealthhalutils"],
Yifan Hongacd2d302018-05-04 14:20:34 -070070 header_libs: ["libbatteryservice_headers"],
Yifan Hong70c44e72018-01-16 17:50:58 -080071
Jin Qiane4f1ec32017-08-15 16:26:53 -070072 logtags: ["EventLogTags.logtags"],
73
Jin Qianebf031b2017-08-14 16:41:24 -070074 proto: {
75 type: "lite",
76 export_proto_headers: true,
77 },
78
Jin Qiane4f1ec32017-08-15 16:26:53 -070079 export_include_dirs: ["include"],
80}
81
82cc_binary {
83 name: "storaged",
84
85 defaults: ["storaged_defaults"],
86
87 init_rc: ["storaged.rc"],
88
89 srcs: ["main.cpp"],
90
Yifan Hong70c44e72018-01-16 17:50:58 -080091 static_libs: [
92 "libhealthhalutils",
93 "libstoraged",
94 ],
Jin Qiane4f1ec32017-08-15 16:26:53 -070095}
96
97/*
98 * Run with:
99 * adb shell /data/nativetest/storaged-unit-tests/storaged-unit-tests
100 */
101cc_test {
102 name: "storaged-unit-tests",
103
104 defaults: ["storaged_defaults"],
105
106 srcs: ["tests/storaged_test.cpp"],
107
Yifan Hongc4b46e02018-01-16 15:49:08 -0800108 static_libs: [
109 "libhealthhalutils",
110 "libstoraged",
111 ],
Yifan Hongbf2dcb22017-09-27 14:01:30 -0700112}
Colin Crossc2a3a202017-11-25 08:46:56 -0800113
114// AIDL interface between storaged and framework.jar
115filegroup {
116 name: "storaged_aidl",
117 srcs: [
118 "binder/android/os/IStoraged.aidl",
119 ],
Dan Willemsenc53f5c12018-09-14 21:27:31 -0700120 path: "binder",
121}
122
123filegroup {
124 name: "storaged_aidl_private",
125 srcs: [
126 "binder/android/os/storaged/IStoragedPrivate.aidl",
127 ],
128 path: "binder",
Colin Crossc2a3a202017-11-25 08:46:56 -0800129}