1/*
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: [
21        "android.hardware.health@1.0",
22        "android.hardware.health@2.0",
23        "libbase",
24        "libbinder",
25        "libcutils",
26        "libhidlbase",
27        "liblog",
28        "libprotobuf-cpp-lite",
29        "libsysutils",
30        "libutils",
31        "libz",
32    ],
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
47    aidl: {
48        export_aidl_headers: true,
49        local_include_dirs: ["binder"],
50        include_dirs: ["frameworks/native/aidl/binder"],
51    },
52
53    srcs: [
54        "storaged.cpp",
55        "storaged_diskstats.cpp",
56        "storaged_info.cpp",
57        "storaged_service.cpp",
58        "storaged_utils.cpp",
59        "storaged_uid_monitor.cpp",
60        "uid_info.cpp",
61        "storaged.proto",
62        ":storaged_aidl",
63        ":storaged_aidl_private",
64    ],
65
66    static_libs: ["libhealthhalutils"],
67    header_libs: ["libbatteryservice_headers"],
68
69    logtags: ["EventLogTags.logtags"],
70
71    proto: {
72        type: "lite",
73        export_proto_headers: true,
74    },
75
76    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
88    static_libs: [
89        "libhealthhalutils",
90        "libstoraged",
91    ],
92}
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
105    static_libs: [
106        "libhealthhalutils",
107        "libstoraged",
108    ],
109}
110
111// AIDL interface between storaged and framework.jar
112filegroup {
113    name: "storaged_aidl",
114    srcs: [
115        "binder/android/os/IStoraged.aidl",
116    ],
117    path: "binder",
118}
119
120filegroup {
121    name: "storaged_aidl_private",
122    srcs: [
123        "binder/android/os/storaged/IStoragedPrivate.aidl",
124    ],
125    path: "binder",
126}
127