blob: cc19481bcacda595bfd5d09b63e66a6ad3d702f4 [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",
Jin Qiane4f1ec32017-08-15 16:26:53 -070027 "liblog",
Jin Qianebf031b2017-08-14 16:41:24 -070028 "libprotobuf-cpp-lite",
Jin Qiane4f1ec32017-08-15 16:26:53 -070029 "libsysutils",
30 "libutils",
Jin Qianebf031b2017-08-14 16:41:24 -070031 "libz",
Jin Qiane4f1ec32017-08-15 16:26:53 -070032 ],
33
34 cflags: [
35 "-Wall",
36 "-Werror",
37 "-Wextra",
38 "-Wno-unused-parameter"
39 ],
40}
41
42cc_library_static {
43 name: "libstoraged",
44
45 defaults: ["storaged_defaults"],
46
Jin Qianb049d182017-10-12 17:02:17 -070047 aidl: {
48 export_aidl_headers: true,
49 local_include_dirs: ["binder"],
50 include_dirs: ["frameworks/native/aidl/binder"],
51 },
52
Jin Qiane4f1ec32017-08-15 16:26:53 -070053 srcs: [
54 "storaged.cpp",
Jin Qian65dea712017-08-29 16:48:20 -070055 "storaged_diskstats.cpp",
Jin Qiane4f1ec32017-08-15 16:26:53 -070056 "storaged_info.cpp",
57 "storaged_service.cpp",
58 "storaged_utils.cpp",
59 "storaged_uid_monitor.cpp",
Jin Qianb049d182017-10-12 17:02:17 -070060 "uid_info.cpp",
Jin Qianebf031b2017-08-14 16:41:24 -070061 "storaged.proto",
Colin Crossc2a3a202017-11-25 08:46:56 -080062 ":storaged_aidl",
Dan Willemsenc53f5c12018-09-14 21:27:31 -070063 ":storaged_aidl_private",
Jin Qiane4f1ec32017-08-15 16:26:53 -070064 ],
65
Yifan Hong70c44e72018-01-16 17:50:58 -080066 static_libs: ["libhealthhalutils"],
Yifan Hongacd2d302018-05-04 14:20:34 -070067 header_libs: ["libbatteryservice_headers"],
Yifan Hong70c44e72018-01-16 17:50:58 -080068
Jin Qiane4f1ec32017-08-15 16:26:53 -070069 logtags: ["EventLogTags.logtags"],
70
Jin Qianebf031b2017-08-14 16:41:24 -070071 proto: {
72 type: "lite",
73 export_proto_headers: true,
74 },
75
Jin Qiane4f1ec32017-08-15 16:26:53 -070076 export_include_dirs: ["include"],
77}
78
79cc_binary {
80 name: "storaged",
81
82 defaults: ["storaged_defaults"],
83
84 init_rc: ["storaged.rc"],
85
86 srcs: ["main.cpp"],
87
Yifan Hong70c44e72018-01-16 17:50:58 -080088 static_libs: [
89 "libhealthhalutils",
90 "libstoraged",
91 ],
Jin Qiane4f1ec32017-08-15 16:26:53 -070092}
93
94/*
95 * Run with:
96 * adb shell /data/nativetest/storaged-unit-tests/storaged-unit-tests
97 */
98cc_test {
99 name: "storaged-unit-tests",
100
101 defaults: ["storaged_defaults"],
102
103 srcs: ["tests/storaged_test.cpp"],
104
Yifan Hongc4b46e02018-01-16 15:49:08 -0800105 static_libs: [
106 "libhealthhalutils",
107 "libstoraged",
108 ],
Yifan Hongbf2dcb22017-09-27 14:01:30 -0700109}
Colin Crossc2a3a202017-11-25 08:46:56 -0800110
111// AIDL interface between storaged and framework.jar
112filegroup {
113 name: "storaged_aidl",
114 srcs: [
115 "binder/android/os/IStoraged.aidl",
116 ],
Dan Willemsenc53f5c12018-09-14 21:27:31 -0700117 path: "binder",
118}
119
120filegroup {
121 name: "storaged_aidl_private",
122 srcs: [
123 "binder/android/os/storaged/IStoragedPrivate.aidl",
124 ],
125 path: "binder",
Colin Crossc2a3a202017-11-25 08:46:56 -0800126}