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        "libhidltransport",
28        "libhwbinder",
29        "liblog",
30        "libprotobuf-cpp-lite",
31        "libsysutils",
32        "libutils",
33        "libz",
34    ],
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
49    aidl: {
50        export_aidl_headers: true,
51        local_include_dirs: ["binder"],
52        include_dirs: ["frameworks/native/aidl/binder"],
53    },
54
55    srcs: [
56        "storaged.cpp",
57        "storaged_diskstats.cpp",
58        "storaged_info.cpp",
59        "storaged_service.cpp",
60        "storaged_utils.cpp",
61        "storaged_uid_monitor.cpp",
62        "uid_info.cpp",
63        "storaged.proto",
64        ":storaged_aidl",
65        "binder/android/os/storaged/IStoragedPrivate.aidl",
66    ],
67
68    static_libs: ["libhealthhalutils"],
69
70    logtags: ["EventLogTags.logtags"],
71
72    proto: {
73        type: "lite",
74        export_proto_headers: true,
75    },
76
77    export_include_dirs: ["include"],
78}
79
80cc_binary {
81    name: "storaged",
82
83    defaults: ["storaged_defaults"],
84
85    init_rc: ["storaged.rc"],
86
87    srcs: ["main.cpp"],
88
89    static_libs: [
90        "libhealthhalutils",
91        "libstoraged",
92    ],
93}
94
95/*
96 * Run with:
97 *  adb shell /data/nativetest/storaged-unit-tests/storaged-unit-tests
98 */
99cc_test {
100    name: "storaged-unit-tests",
101
102    defaults: ["storaged_defaults"],
103
104    srcs: ["tests/storaged_test.cpp"],
105
106    static_libs: [
107        "libhealthhalutils",
108        "libstoraged",
109    ],
110}
111
112// AIDL interface between storaged and framework.jar
113filegroup {
114    name: "storaged_aidl",
115    srcs: [
116        "binder/android/os/IStoraged.aidl",
117    ],
118}
119