Jin Qian | e4f1ec3 | 2017-08-15 16:26:53 -0700 | [diff] [blame] | 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 | |
Bob Badour | d69ad69 | 2021-02-16 19:02:14 -0800 | [diff] [blame] | 17 | package { |
| 18 | default_applicable_licenses: ["Android-Apache-2.0"], |
| 19 | } |
| 20 | |
Jin Qian | e4f1ec3 | 2017-08-15 16:26:53 -0700 | [diff] [blame] | 21 | cc_defaults { |
| 22 | name: "storaged_defaults", |
| 23 | |
| 24 | shared_libs: [ |
Yifan Hong | bf2dcb2 | 2017-09-27 14:01:30 -0700 | [diff] [blame] | 25 | "android.hardware.health@1.0", |
| 26 | "android.hardware.health@2.0", |
Yifan Hong | 5291a67 | 2021-12-06 14:29:40 -0800 | [diff] [blame] | 27 | "android.hardware.health-V1-ndk", |
Jin Qian | e4f1ec3 | 2017-08-15 16:26:53 -0700 | [diff] [blame] | 28 | "libbase", |
Jin Qian | e4f1ec3 | 2017-08-15 16:26:53 -0700 | [diff] [blame] | 29 | "libbinder", |
Yifan Hong | 5291a67 | 2021-12-06 14:29:40 -0800 | [diff] [blame] | 30 | "libbinder_ndk", |
Jin Qian | e4f1ec3 | 2017-08-15 16:26:53 -0700 | [diff] [blame] | 31 | "libcutils", |
Yifan Hong | bf2dcb2 | 2017-09-27 14:01:30 -0700 | [diff] [blame] | 32 | "libhidlbase", |
Jin Qian | e4f1ec3 | 2017-08-15 16:26:53 -0700 | [diff] [blame] | 33 | "liblog", |
Jin Qian | ebf031b | 2017-08-14 16:41:24 -0700 | [diff] [blame] | 34 | "libprotobuf-cpp-lite", |
Jin Qian | e4f1ec3 | 2017-08-15 16:26:53 -0700 | [diff] [blame] | 35 | "libutils", |
Jin Qian | ebf031b | 2017-08-14 16:41:24 -0700 | [diff] [blame] | 36 | "libz", |
Samiul Islam | 26eeec7 | 2021-08-26 15:17:53 +0100 | [diff] [blame] | 37 | "packagemanager_aidl-cpp", |
Jin Qian | e4f1ec3 | 2017-08-15 16:26:53 -0700 | [diff] [blame] | 38 | ], |
| 39 | |
Yifan Hong | 5291a67 | 2021-12-06 14:29:40 -0800 | [diff] [blame] | 40 | static_libs: [ |
| 41 | "android.hardware.health-translate-ndk", |
| 42 | "libhealthhalutils", |
| 43 | "libhealthshim", |
| 44 | ], |
| 45 | |
Jin Qian | e4f1ec3 | 2017-08-15 16:26:53 -0700 | [diff] [blame] | 46 | cflags: [ |
| 47 | "-Wall", |
| 48 | "-Werror", |
| 49 | "-Wextra", |
| 50 | "-Wno-unused-parameter" |
| 51 | ], |
| 52 | } |
| 53 | |
| 54 | cc_library_static { |
| 55 | name: "libstoraged", |
| 56 | |
| 57 | defaults: ["storaged_defaults"], |
| 58 | |
Jin Qian | b049d18 | 2017-10-12 17:02:17 -0700 | [diff] [blame] | 59 | aidl: { |
| 60 | export_aidl_headers: true, |
| 61 | local_include_dirs: ["binder"], |
| 62 | include_dirs: ["frameworks/native/aidl/binder"], |
| 63 | }, |
| 64 | |
Jin Qian | e4f1ec3 | 2017-08-15 16:26:53 -0700 | [diff] [blame] | 65 | srcs: [ |
| 66 | "storaged.cpp", |
Jin Qian | 65dea71 | 2017-08-29 16:48:20 -0700 | [diff] [blame] | 67 | "storaged_diskstats.cpp", |
Jin Qian | e4f1ec3 | 2017-08-15 16:26:53 -0700 | [diff] [blame] | 68 | "storaged_info.cpp", |
| 69 | "storaged_service.cpp", |
| 70 | "storaged_utils.cpp", |
| 71 | "storaged_uid_monitor.cpp", |
Jin Qian | b049d18 | 2017-10-12 17:02:17 -0700 | [diff] [blame] | 72 | "uid_info.cpp", |
Jin Qian | ebf031b | 2017-08-14 16:41:24 -0700 | [diff] [blame] | 73 | "storaged.proto", |
Colin Cross | c2a3a20 | 2017-11-25 08:46:56 -0800 | [diff] [blame] | 74 | ":storaged_aidl", |
Dan Willemsen | c53f5c1 | 2018-09-14 21:27:31 -0700 | [diff] [blame] | 75 | ":storaged_aidl_private", |
Jin Qian | e4f1ec3 | 2017-08-15 16:26:53 -0700 | [diff] [blame] | 76 | ], |
| 77 | |
Yifan Hong | acd2d30 | 2018-05-04 14:20:34 -0700 | [diff] [blame] | 78 | header_libs: ["libbatteryservice_headers"], |
Yifan Hong | 70c44e7 | 2018-01-16 17:50:58 -0800 | [diff] [blame] | 79 | |
Jin Qian | e4f1ec3 | 2017-08-15 16:26:53 -0700 | [diff] [blame] | 80 | logtags: ["EventLogTags.logtags"], |
| 81 | |
Jin Qian | ebf031b | 2017-08-14 16:41:24 -0700 | [diff] [blame] | 82 | proto: { |
| 83 | type: "lite", |
| 84 | export_proto_headers: true, |
| 85 | }, |
| 86 | |
Jin Qian | e4f1ec3 | 2017-08-15 16:26:53 -0700 | [diff] [blame] | 87 | export_include_dirs: ["include"], |
| 88 | } |
| 89 | |
| 90 | cc_binary { |
| 91 | name: "storaged", |
| 92 | |
| 93 | defaults: ["storaged_defaults"], |
| 94 | |
| 95 | init_rc: ["storaged.rc"], |
| 96 | |
| 97 | srcs: ["main.cpp"], |
| 98 | |
Yifan Hong | 70c44e7 | 2018-01-16 17:50:58 -0800 | [diff] [blame] | 99 | static_libs: [ |
Yifan Hong | 70c44e7 | 2018-01-16 17:50:58 -0800 | [diff] [blame] | 100 | "libstoraged", |
| 101 | ], |
Jin Qian | e4f1ec3 | 2017-08-15 16:26:53 -0700 | [diff] [blame] | 102 | } |
| 103 | |
| 104 | /* |
| 105 | * Run with: |
| 106 | * adb shell /data/nativetest/storaged-unit-tests/storaged-unit-tests |
| 107 | */ |
| 108 | cc_test { |
| 109 | name: "storaged-unit-tests", |
| 110 | |
| 111 | defaults: ["storaged_defaults"], |
| 112 | |
| 113 | srcs: ["tests/storaged_test.cpp"], |
| 114 | |
Yifan Hong | c4b46e0 | 2018-01-16 15:49:08 -0800 | [diff] [blame] | 115 | static_libs: [ |
Yifan Hong | c4b46e0 | 2018-01-16 15:49:08 -0800 | [diff] [blame] | 116 | "libstoraged", |
| 117 | ], |
Yifan Hong | 1407fd0 | 2021-12-06 23:04:12 -0800 | [diff] [blame] | 118 | test_suites: [ |
| 119 | "general-tests", |
| 120 | ], |
Yifan Hong | bf2dcb2 | 2017-09-27 14:01:30 -0700 | [diff] [blame] | 121 | } |
Colin Cross | c2a3a20 | 2017-11-25 08:46:56 -0800 | [diff] [blame] | 122 | |
| 123 | // AIDL interface between storaged and framework.jar |
| 124 | filegroup { |
| 125 | name: "storaged_aidl", |
| 126 | srcs: [ |
| 127 | "binder/android/os/IStoraged.aidl", |
| 128 | ], |
Dan Willemsen | c53f5c1 | 2018-09-14 21:27:31 -0700 | [diff] [blame] | 129 | path: "binder", |
| 130 | } |
| 131 | |
| 132 | filegroup { |
| 133 | name: "storaged_aidl_private", |
| 134 | srcs: [ |
| 135 | "binder/android/os/storaged/IStoragedPrivate.aidl", |
| 136 | ], |
| 137 | path: "binder", |
Colin Cross | c2a3a20 | 2017-11-25 08:46:56 -0800 | [diff] [blame] | 138 | } |