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