• Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
17package {
18    default_applicable_licenses: ["Android-Apache-2.0"],
19}
20
21cc_defaults {
22    name: "storaged_defaults",
23
24    shared_libs: [
25        "android.hardware.health@1.0",
26        "android.hardware.health@2.0",
27        "libbase",
28        "libbinder",
29        "libcutils",
30        "libhidlbase",
31        "liblog",
32        "libprotobuf-cpp-lite",
33        "libsysutils",
34        "libutils",
35        "libz",
36    ],
37
38    cflags: [
39        "-Wall",
40        "-Werror",
41        "-Wextra",
42        "-Wno-unused-parameter"
43    ],
44}
45
46cc_library_static {
47    name: "libstoraged",
48
49    defaults: ["storaged_defaults"],
50
51    aidl: {
52        export_aidl_headers: true,
53        local_include_dirs: ["binder"],
54        include_dirs: ["frameworks/native/aidl/binder"],
55    },
56
57    srcs: [
58        "storaged.cpp",
59        "storaged_diskstats.cpp",
60        "storaged_info.cpp",
61        "storaged_service.cpp",
62        "storaged_utils.cpp",
63        "storaged_uid_monitor.cpp",
64        "uid_info.cpp",
65        "storaged.proto",
66        ":storaged_aidl",
67        ":storaged_aidl_private",
68    ],
69
70    static_libs: ["libhealthhalutils"],
71    header_libs: ["libbatteryservice_headers"],
72
73    logtags: ["EventLogTags.logtags"],
74
75    proto: {
76        type: "lite",
77        export_proto_headers: true,
78    },
79
80    export_include_dirs: ["include"],
81}
82
83cc_binary {
84    name: "storaged",
85
86    defaults: ["storaged_defaults"],
87
88    init_rc: ["storaged.rc"],
89
90    srcs: ["main.cpp"],
91
92    static_libs: [
93        "libhealthhalutils",
94        "libstoraged",
95    ],
96}
97
98/*
99 * Run with:
100 *  adb shell /data/nativetest/storaged-unit-tests/storaged-unit-tests
101 */
102cc_test {
103    name: "storaged-unit-tests",
104
105    defaults: ["storaged_defaults"],
106
107    srcs: ["tests/storaged_test.cpp"],
108
109    static_libs: [
110        "libhealthhalutils",
111        "libstoraged",
112    ],
113}
114
115// AIDL interface between storaged and framework.jar
116filegroup {
117    name: "storaged_aidl",
118    srcs: [
119        "binder/android/os/IStoraged.aidl",
120    ],
121    path: "binder",
122}
123
124filegroup {
125    name: "storaged_aidl_private",
126    srcs: [
127        "binder/android/os/storaged/IStoragedPrivate.aidl",
128    ],
129    path: "binder",
130}
131