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