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