1// 2// Copyright (C) 2021 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 21rust_bindgen { 22 name: "libstatspull_bindgen", 23 wrapper_src: "statslog.h", 24 crate_name: "statspull_bindgen", 25 visibility: [ 26 "//frameworks/proto_logging/stats/stats_log_api_gen", 27 "//packages/modules/Virtualization/libs/statslog_virtualization", 28 ], 29 source_stem: "bindings", 30 bindgen_flags: [ 31 "--allowlist-function=AStatsEventList_addStatsEvent", 32 "--allowlist-function=AStatsEvent_.*", 33 "--allowlist-function=AStatsManager_.*", 34 "--allowlist-var=AStatsManager_.*", 35 ], 36 target: { 37 android: { 38 shared_libs: [ 39 "libstatspull", 40 "libstatssocket", 41 ], 42 }, 43 host: { 44 static_libs: [ 45 "libstatspull", 46 "libstatssocket", 47 ], 48 }, 49 }, 50 min_sdk_version: "apex_inherit", 51 apex_available: [ 52 "//apex_available:platform", 53 "com.android.resolv", 54 "com.android.virt", 55 ], 56} 57 58rust_library { 59 name: "libstatspull_rust", 60 crate_name: "statspull_rust", 61 srcs: ["stats_pull.rs"], 62 rustlibs: [ 63 "liblog_rust", 64 "libstatslog_rust_header", 65 "libstatspull_bindgen", 66 ], 67} 68 69rust_test { 70 name: "libstatspull_bindgen_test", 71 srcs: [":libstatspull_bindgen"], 72 crate_name: "statspull_bindgen_test", 73 test_suites: ["general-tests"], 74 auto_gen_config: true, 75 clippy_lints: "none", 76 lints: "none", 77} 78