blob: 733b60fe4597719e3ad8c10bc5970ca661b1089b [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
17cc_defaults {
18 name: "storaged_defaults",
19
20 shared_libs: [
Yifan Hongbf2dcb22017-09-27 14:01:30 -070021 "android.hardware.health@1.0",
22 "android.hardware.health@2.0",
Jin Qiane4f1ec32017-08-15 16:26:53 -070023 "libbase",
Jin Qiane4f1ec32017-08-15 16:26:53 -070024 "libbinder",
25 "libcutils",
Yifan Hongbf2dcb22017-09-27 14:01:30 -070026 "libhidlbase",
27 "libhidltransport",
28 "libhwbinder",
Jin Qiane4f1ec32017-08-15 16:26:53 -070029 "liblog",
Jin Qianebf031b2017-08-14 16:41:24 -070030 "libprotobuf-cpp-lite",
Jin Qiane4f1ec32017-08-15 16:26:53 -070031 "libsysutils",
32 "libutils",
Jin Qianebf031b2017-08-14 16:41:24 -070033 "libz",
Jin Qiane4f1ec32017-08-15 16:26:53 -070034 ],
35
36 cflags: [
37 "-Wall",
38 "-Werror",
39 "-Wextra",
40 "-Wno-unused-parameter"
41 ],
42}
43
44cc_library_static {
45 name: "libstoraged",
46
47 defaults: ["storaged_defaults"],
48
Jin Qianb049d182017-10-12 17:02:17 -070049 aidl: {
50 export_aidl_headers: true,
51 local_include_dirs: ["binder"],
52 include_dirs: ["frameworks/native/aidl/binder"],
53 },
54
Jin Qiane4f1ec32017-08-15 16:26:53 -070055 srcs: [
56 "storaged.cpp",
Jin Qian65dea712017-08-29 16:48:20 -070057 "storaged_diskstats.cpp",
Jin Qiane4f1ec32017-08-15 16:26:53 -070058 "storaged_info.cpp",
59 "storaged_service.cpp",
60 "storaged_utils.cpp",
61 "storaged_uid_monitor.cpp",
Jin Qianb049d182017-10-12 17:02:17 -070062 "uid_info.cpp",
Jin Qianebf031b2017-08-14 16:41:24 -070063 "storaged.proto",
Colin Crossc2a3a202017-11-25 08:46:56 -080064 ":storaged_aidl",
Dan Willemsenc53f5c12018-09-14 21:27:31 -070065 ":storaged_aidl_private",
Jin Qiane4f1ec32017-08-15 16:26:53 -070066 ],
67
Yifan Hong70c44e72018-01-16 17:50:58 -080068 static_libs: ["libhealthhalutils"],
Yifan Hongacd2d302018-05-04 14:20:34 -070069 header_libs: ["libbatteryservice_headers"],
Yifan Hong70c44e72018-01-16 17:50:58 -080070
Jin Qiane4f1ec32017-08-15 16:26:53 -070071 logtags: ["EventLogTags.logtags"],
72
Jin Qianebf031b2017-08-14 16:41:24 -070073 proto: {
74 type: "lite",
75 export_proto_headers: true,
76 },
77
Jin Qiane4f1ec32017-08-15 16:26:53 -070078 export_include_dirs: ["include"],
79}
80
81cc_binary {
82 name: "storaged",
83
84 defaults: ["storaged_defaults"],
85
86 init_rc: ["storaged.rc"],
87
88 srcs: ["main.cpp"],
89
Yifan Hong70c44e72018-01-16 17:50:58 -080090 static_libs: [
91 "libhealthhalutils",
92 "libstoraged",
93 ],
Jin Qiane4f1ec32017-08-15 16:26:53 -070094}
95
96/*
97 * Run with:
98 * adb shell /data/nativetest/storaged-unit-tests/storaged-unit-tests
99 */
100cc_test {
101 name: "storaged-unit-tests",
102
103 defaults: ["storaged_defaults"],
104
105 srcs: ["tests/storaged_test.cpp"],
106
Yifan Hongc4b46e02018-01-16 15:49:08 -0800107 static_libs: [
108 "libhealthhalutils",
109 "libstoraged",
110 ],
Yifan Hongbf2dcb22017-09-27 14:01:30 -0700111}
Colin Crossc2a3a202017-11-25 08:46:56 -0800112
113// AIDL interface between storaged and framework.jar
114filegroup {
115 name: "storaged_aidl",
116 srcs: [
117 "binder/android/os/IStoraged.aidl",
118 ],
Dan Willemsenc53f5c12018-09-14 21:27:31 -0700119 path: "binder",
120}
121
122filegroup {
123 name: "storaged_aidl_private",
124 srcs: [
125 "binder/android/os/storaged/IStoragedPrivate.aidl",
126 ],
127 path: "binder",
Colin Crossc2a3a202017-11-25 08:46:56 -0800128}