1// 2// Copyright (C) 2019 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// ========================================================== 18// Native library to register a pull atom callback with statsd 19// ========================================================== 20package { 21 default_applicable_licenses: ["Android-Apache-2.0"], 22} 23 24cc_defaults { 25 name: "libstatspull_defaults", 26 srcs: [ 27 "stats_pull_atom_callback.cpp", 28 ], 29 cflags: [ 30 "-Wall", 31 "-Werror", 32 ], 33 export_include_dirs: ["include"], 34 shared_libs: [ 35 "libbinder_ndk", 36 "liblog", 37 ], 38 static_libs: [ 39 "libutils", 40 "statsd-aidl-ndk", 41 ], 42 target: { 43 android: { 44 shared_libs: ["libstatssocket"], 45 }, 46 host: { 47 static_libs: ["libstatssocket"], 48 }, 49 }, 50} 51cc_library { 52 name: "libstatspull", 53 defaults: [ 54 "libstatspull_defaults", 55 ], 56 host_supported: true, 57 target: { 58 android: { 59 static: { 60 enabled: false, 61 }, 62 }, 63 host: { 64 shared: { 65 enabled: false, 66 }, 67 }, 68 darwin: { 69 enabled: false, 70 }, 71 }, 72 // enumerate stable entry points for APEX use 73 stubs: { 74 symbol_file: "libstatspull.map.txt", 75 versions: [ 76 "30", 77 ], 78 }, 79 apex_available: [ 80 "com.android.os.statsd", 81 "test_com.android.os.statsd", 82 ], 83 min_sdk_version: "30", 84 85 stl: "libc++_static", 86 87 // TODO(b/151102177): Enable it when the build error is fixed. 88 header_abi_checker: { 89 enabled: false, 90 }, 91} 92 93cc_library_headers { 94 name: "libstatspull_headers", 95 export_include_dirs: ["include"], 96} 97 98// ONLY USE IN TESTS. 99cc_library_static { 100 name: "libstatspull_private", 101 defaults: [ 102 "libstatspull_defaults", 103 ], 104 cflags: [ 105 "-DLIB_STATS_PULL_TESTS_FLAG", 106 ], 107 visibility: [ 108 "//packages/modules/StatsD/apex/tests/libstatspull", 109 ], 110} 111 112// Note: These unit tests only test PullAtomMetadata. 113// For full E2E tests of libstatspull, use LibStatsPullTests 114cc_test { 115 name: "libstatspull_test", 116 srcs: [ 117 "tests/pull_atom_metadata_test.cpp", 118 ], 119 shared_libs: [ 120 "libstatspull", 121 "libstatssocket", 122 ], 123 test_suites: ["general-tests", "mts-statsd"], 124 test_config: "libstatspull_test.xml", 125 126 //TODO(b/153588990): Remove when the build system properly separates 127 //32bit and 64bit architectures. 128 compile_multilib: "both", 129 multilib: { 130 lib64: { 131 suffix: "64", 132 }, 133 lib32: { 134 suffix: "32", 135 }, 136 }, 137 cflags: [ 138 "-Wall", 139 "-Werror", 140 "-Wno-missing-field-initializers", 141 "-Wno-unused-variable", 142 "-Wno-unused-function", 143 "-Wno-unused-parameter", 144 ], 145 require_root: true, 146} 147